🚨 Very experimental 🚨
Type-safe access to DOM and other Web APIs from Swift, using @webref/idl package to generate the bindings and JavaScriptKit to enable access to the actual objects.
Global
helpers by @MaxDesiatov in #3queriedButton
not button
in the test by @MaxDesiatov in #6TypedArray.swift
by @MaxDesiatov in #11GITHUB_TOKEN
in test.yml
by @MaxDesiatov in #12streams
IDL spec and generated code by @MaxDesiatov in #15console
, fix DOMKitDemo
build by @MaxDesiatov in #21.swift-version
by @MaxDesiatov in #20css-pseudo
and cssom-view
generated code by @MaxDesiatov in #25websockets
IDL spec and generated code by @MaxDesiatov in #27mediacapture-streams
IDL spec and generated code by @MaxDesiatov in #23mediastream-recording
IDL and generated code by @MaxDesiatov in #24webcodecs
IDL spec and generated code by @MaxDesiatov in #16webgl1
IDL spec and generated code by @MaxDesiatov in #17webgl2
IDL spec and generated code by @MaxDesiatov in #18webgpu
IDL spec and generated code by @MaxDesiatov in #38@webref/idl
instead of webidl2swift
by @MaxDesiatov in #40GLintptr
IDL type to Swift Int32
by @MaxDesiatov in #42(Offscreen)RenderingContext
protocols by @MaxDesiatov in #45Full Changelog: https://github.com/swiftwasm/WebAPIKit/commits/0.1.0
🚨 Very experimental 🚨
Type-safe access to DOM and other Web APIs from Swift, using @webref/idl package to generate the bindings and JavaScriptKit to enable access to the actual objects.
{ "name": "WebAPIKit", "path": "/usr/src/package", "targets": [ { "name": "WebSockets", "path": "Sources/WebSockets", "type": "library", "c99name": "WebSockets", "sources": [ "Generated.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "WebSockets" ], "target_dependencies": [ "DOM", "WebAPIBase", "ECMAScript" ] }, { "name": "WebIDLToSwift", "path": "Sources/WebIDLToSwift", "type": "executable", "c99name": "WebIDLToSwift", "sources": [ "ClosurePattern.swift", "IDLBuilder.swift", "IDLParser.swift", "MergeDeclarations.swift", "Module.swift", "ModuleState.swift", "PackageManifest.swift", "Shell.swift", "SwiftRepresentation.swift", "SwiftSource.swift", "UnionType+SwiftRepresentable.swift", "UnionType.swift", "WebIDL+SwiftRepresentation.swift", "WebIDLToSwift.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "WebIDLToSwift" ], "target_dependencies": [ "WebIDL" ] }, { "name": "WebIDL", "path": "Sources/WebIDL", "type": "library", "c99name": "WebIDL", "sources": [ "Argument.swift", "Attribute.swift", "Callback.swift", "Constant.swift", "Constructor.swift", "Declaration.swift", "Dictionary.swift", "Enum.swift", "ExtendedAttribute.swift", "GenericCollection.swift", "Includes.swift", "Interface.swift", "InterfaceMixin.swift", "Namespace.swift", "Node.swift", "Operation.swift", "Type.swift", "Typedef.swift", "Value.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "WebIDLToSwift" ] }, { "name": "WebGPU", "path": "Sources/WebGPU", "type": "library", "c99name": "WebGPU", "sources": [ "Generated.swift", "Support.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "WebGPU" ], "target_dependencies": [ "DOM", "WebAPIBase", "WebAudio", "WebAnimations", "WebGL1", "ECMAScript" ] }, { "name": "WebGL2", "path": "Sources/WebGL2", "type": "library", "c99name": "WebGL2", "sources": [ "Generated.swift", "Support.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "WebAPIKitDemo", "WebGL2" ], "target_dependencies": [ "DOM", "WebAPIBase", "WebAudio", "WebAnimations", "WebGL1", "ECMAScript" ] }, { "name": "WebGL1", "path": "Sources/WebGL1", "type": "library", "c99name": "WebGL1", "sources": [ "Generated.swift", "Support.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "WebAPIKitDemo", "WebGL1", "WebGL2", "WebGPU" ], "target_dependencies": [ "DOM", "WebAPIBase", "WebAudio", "WebAnimations", "ECMAScript" ] }, { "name": "WebAudio", "path": "Sources/WebAudio", "type": "library", "c99name": "WebAudio", "sources": [ "Generated.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "WebAPIKitDemo", "WebAudio", "WebAnimations", "WebGL1", "WebGL2", "WebGPU" ], "target_dependencies": [ "DOM", "WebAPIBase", "ECMAScript" ] }, { "name": "WebAnimations", "path": "Sources/WebAnimations", "type": "library", "c99name": "WebAnimations", "sources": [ "Generated.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "WebAPIKitDemo", "WebAnimations", "WebGL1", "WebGL2", "WebGPU" ], "target_dependencies": [ "DOM", "WebAPIBase", "WebAudio", "ECMAScript" ] }, { "name": "WebAPIKitTests", "path": "Tests/WebAPIKitTests", "type": "test", "c99name": "WebAPIKitTests", "sources": [ "WebAPIKitTests.swift" ], "module_type": "SwiftTarget", "target_dependencies": [ "DOM" ] }, { "name": "WebAPIKitDemo", "path": "Sources/WebAPIKitDemo", "type": "executable", "c99name": "WebAPIKitDemo", "sources": [ "WebGLDemo.swift", "main.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "WebAPIKitDemo" ], "target_dependencies": [ "DOM", "WebGL2" ] }, { "name": "WebAPIBase", "path": "Sources/WebAPIBase", "type": "library", "c99name": "WebAPIBase", "sources": [ "Generated.swift", "ToJSValue.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "WebAPIKitDemo", "WebAPIBase", "DOM", "WebSockets", "WebAudio", "WebAnimations", "WebGL1", "WebGL2", "WebGPU", "Gamepad", "CSSOM", "SVG", "FileSystem" ], "target_dependencies": [ "ECMAScript" ] }, { "name": "SVG", "path": "Sources/SVG", "type": "library", "c99name": "SVG", "sources": [ "Generated.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "CSSOM", "SVG" ], "target_dependencies": [ "DOM", "WebAPIBase", "ECMAScript" ] }, { "name": "Gamepad", "path": "Sources/Gamepad", "type": "library", "c99name": "Gamepad", "sources": [ "Generated.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "Gamepad" ], "target_dependencies": [ "DOM", "WebAPIBase", "ECMAScript" ] }, { "name": "FileSystem", "path": "Sources/FileSystem", "type": "library", "c99name": "FileSystem", "sources": [ "Generated.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "FileSystem" ], "target_dependencies": [ "DOM", "WebAPIBase", "ECMAScript" ] }, { "name": "ECMAScript", "path": "Sources/ECMAScript", "type": "library", "c99name": "ECMAScript", "sources": [ "ArrayBuffer.swift", "ArrayBufferView.swift", "Attributes.swift", "BridgedDictionary.swift", "DataView.swift", "Iterators.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "WebAPIKitDemo", "WebAPIBase", "DOM", "WebSockets", "WebAudio", "WebAnimations", "WebGL1", "WebGL2", "WebGPU", "Gamepad", "CSSOM", "SVG", "FileSystem" ], "product_dependencies": [ "JavaScriptKit", "JavaScriptEventLoop", "JavaScriptBigIntSupport" ] }, { "name": "DOM", "path": "Sources/DOM", "type": "library", "c99name": "DOM", "sources": [ "Generated.swift", "RenderingContext.swift", "RotationMatrixType.swift", "Support.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "WebAPIKitDemo", "DOM", "WebSockets", "WebAudio", "WebAnimations", "WebGL1", "WebGL2", "WebGPU", "Gamepad", "CSSOM", "SVG", "FileSystem" ], "target_dependencies": [ "WebAPIBase", "ECMAScript" ] }, { "name": "CSSOM", "path": "Sources/CSSOM", "type": "library", "c99name": "CSSOM", "sources": [ "Generated.swift" ], "module_type": "SwiftTarget", "product_memberships": [ "CSSOM" ], "target_dependencies": [ "DOM", "WebAPIBase", "SVG", "ECMAScript" ] } ], "products": [ { "name": "WebAPIKitDemo", "type": { "executable": null }, "targets": [ "WebAPIKitDemo" ] }, { "name": "WebAPIBase", "type": { "library": [ "automatic" ] }, "targets": [ "WebAPIBase" ] }, { "name": "DOM", "type": { "library": [ "automatic" ] }, "targets": [ "DOM" ] }, { "name": "WebSockets", "type": { "library": [ "automatic" ] }, "targets": [ "WebSockets" ] }, { "name": "WebAudio", "type": { "library": [ "automatic" ] }, "targets": [ "WebAudio" ] }, { "name": "WebAnimations", "type": { "library": [ "automatic" ] }, "targets": [ "WebAnimations" ] }, { "name": "WebGL1", "type": { "library": [ "automatic" ] }, "targets": [ "WebGL1" ] }, { "name": "WebGL2", "type": { "library": [ "automatic" ] }, "targets": [ "WebGL2" ] }, { "name": "WebGPU", "type": { "library": [ "automatic" ] }, "targets": [ "WebGPU" ] }, { "name": "Gamepad", "type": { "library": [ "automatic" ] }, "targets": [ "Gamepad" ] }, { "name": "CSSOM", "type": { "library": [ "automatic" ] }, "targets": [ "CSSOM" ] }, { "name": "SVG", "type": { "library": [ "automatic" ] }, "targets": [ "SVG" ] }, { "name": "FileSystem", "type": { "library": [ "automatic" ] }, "targets": [ "FileSystem" ] }, { "name": "WebIDLToSwift", "type": { "executable": null }, "targets": [ "WebIDLToSwift" ] } ], "platforms": [ { "name": "macos", "version": "10.13" } ], "dependencies": [ { "url": "https://github.com/swiftwasm/JavaScriptKit.git", "type": "sourceControl", "identity": "javascriptkit", "requirement": { "range": [ { "lower_bound": "0.16.0", "upper_bound": "1.0.0" } ] } } ], "tools_version": "5.5", "manifest_display_name": "WebAPIKit" }
{ "name": "WebAPIKit", "targets": [ { "name": "WebAPIKitDemo", "type": "executable", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "DOM", null ] }, { "byName": [ "WebGL2", null ] } ], "packageAccess": false }, { "name": "WebAPIBase", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "ECMAScript", null ] } ], "packageAccess": false }, { "name": "DOM", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "WebAPIBase", null ] }, { "byName": [ "ECMAScript", null ] } ], "packageAccess": false }, { "name": "WebSockets", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "DOM", null ] }, { "byName": [ "WebAPIBase", null ] }, { "byName": [ "ECMAScript", null ] } ], "packageAccess": false }, { "name": "WebAudio", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "DOM", null ] }, { "byName": [ "WebAPIBase", null ] }, { "byName": [ "ECMAScript", null ] } ], "packageAccess": false }, { "name": "WebAnimations", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "DOM", null ] }, { "byName": [ "WebAPIBase", null ] }, { "byName": [ "WebAudio", null ] }, { "byName": [ "ECMAScript", null ] } ], "packageAccess": false }, { "name": "WebGL1", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "DOM", null ] }, { "byName": [ "WebAPIBase", null ] }, { "byName": [ "WebAudio", null ] }, { "byName": [ "WebAnimations", null ] }, { "byName": [ "ECMAScript", null ] } ], "packageAccess": false }, { "name": "WebGL2", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "DOM", null ] }, { "byName": [ "WebAPIBase", null ] }, { "byName": [ "WebAudio", null ] }, { "byName": [ "WebAnimations", null ] }, { "byName": [ "WebGL1", null ] }, { "byName": [ "ECMAScript", null ] } ], "packageAccess": false }, { "name": "WebGPU", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "DOM", null ] }, { "byName": [ "WebAPIBase", null ] }, { "byName": [ "WebAudio", null ] }, { "byName": [ "WebAnimations", null ] }, { "byName": [ "WebGL1", null ] }, { "byName": [ "ECMAScript", null ] } ], "packageAccess": false }, { "name": "Gamepad", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "DOM", null ] }, { "byName": [ "WebAPIBase", null ] }, { "byName": [ "ECMAScript", null ] } ], "packageAccess": false }, { "name": "CSSOM", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "DOM", null ] }, { "byName": [ "WebAPIBase", null ] }, { "byName": [ "SVG", null ] }, { "byName": [ "ECMAScript", null ] } ], "packageAccess": false }, { "name": "SVG", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "DOM", null ] }, { "byName": [ "WebAPIBase", null ] }, { "byName": [ "ECMAScript", null ] } ], "packageAccess": false }, { "name": "FileSystem", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "DOM", null ] }, { "byName": [ "WebAPIBase", null ] }, { "byName": [ "ECMAScript", null ] } ], "packageAccess": false }, { "name": "ECMAScript", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "JavaScriptKit", null ] }, { "product": [ "JavaScriptEventLoop", "JavaScriptKit", null, null ] }, { "product": [ "JavaScriptBigIntSupport", "JavaScriptKit", null, null ] } ], "packageAccess": false }, { "name": "WebIDL", "type": "regular", "exclude": [], "settings": [], "resources": [], "dependencies": [], "packageAccess": false }, { "name": "WebIDLToSwift", "type": "executable", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "WebIDL", null ] } ], "packageAccess": false }, { "name": "WebAPIKitTests", "type": "test", "exclude": [], "settings": [], "resources": [], "dependencies": [ { "byName": [ "DOM", null ] } ], "packageAccess": false } ], "products": [ { "name": "WebAPIKitDemo", "type": { "executable": null }, "targets": [ "WebAPIKitDemo" ] }, { "name": "WebAPIBase", "type": { "library": [ "automatic" ] }, "targets": [ "WebAPIBase" ] }, { "name": "DOM", "type": { "library": [ "automatic" ] }, "targets": [ "DOM" ] }, { "name": "WebSockets", "type": { "library": [ "automatic" ] }, "targets": [ "WebSockets" ] }, { "name": "WebAudio", "type": { "library": [ "automatic" ] }, "targets": [ "WebAudio" ] }, { "name": "WebAnimations", "type": { "library": [ "automatic" ] }, "targets": [ "WebAnimations" ] }, { "name": "WebGL1", "type": { "library": [ "automatic" ] }, "targets": [ "WebGL1" ] }, { "name": "WebGL2", "type": { "library": [ "automatic" ] }, "targets": [ "WebGL2" ] }, { "name": "WebGPU", "type": { "library": [ "automatic" ] }, "targets": [ "WebGPU" ] }, { "name": "Gamepad", "type": { "library": [ "automatic" ] }, "targets": [ "Gamepad" ] }, { "name": "CSSOM", "type": { "library": [ "automatic" ] }, "targets": [ "CSSOM" ] }, { "name": "SVG", "type": { "library": [ "automatic" ] }, "targets": [ "SVG" ] }, { "name": "FileSystem", "type": { "library": [ "automatic" ] }, "targets": [ "FileSystem" ] }, { "name": "WebIDLToSwift", "type": { "executable": null }, "targets": [ "WebIDLToSwift" ] } ], "pkgConfig": null, "platforms": [ { "options": [], "version": "10.13", "platformName": "macos" } ], "providers": null, "packageKind": { "root": [ "/usr/src/package" ] }, "dependencies": [ { "sourceControl": [ { "identity": "javascriptkit", "location": { "remote": [ { "urlString": "https://github.com/swiftwasm/JavaScriptKit.git" } ] }, "requirement": { "range": [ { "lowerBound": "0.16.0", "upperBound": "1.0.0" } ] }, "productFilter": null } ] } ], "toolsVersion": { "_version": "5.5.0" }, "cLanguageStandard": null, "cxxLanguageStandard": null, "swiftLanguageVersions": null }
{ "url": "/usr/src/package", "name": "WebAPIKit", "path": "/usr/src/package", "version": "unspecified", "identity": "package", "dependencies": [ { "url": "https://github.com/swiftwasm/JavaScriptKit.git", "name": "JavaScriptKit", "path": "/usr/src/package/.build/checkouts/JavaScriptKit", "version": "0.16.0", "identity": "javascriptkit", "dependencies": [] } ] }