WebAPIs, as used in gnorium.com
Swift implementations of Web APIs for Swift WebAssembly environments, enabling JavaScript-like Web API usage in browser-based Swift applications.
WebAPIs provides Swift types and interfaces that mirror standard Web APIs, allowing you to write Swift code for WebAssembly with familiar Web platform conventions.
Built for Swift SDK for WebAssembly, enabling browser-based Swift applications with direct access to DOM, CSS, Storage, and other Web APIs.
- DOM-like APIs: Document manipulation interfaces
- CSS APIs:
CSSStyleDeclaration, color schemes, property setters - Console API:
console.log()equivalents for WebAssembly debugging - Event APIs:
CustomEventand event handling - Dataset APIs: HTML5 dataset attribute handling
Add WebAPIs to your Package.swift:
dependencies: [
.package(url: "https://github.com/gnorium/web-apis", branch: "main")
]Then add it to your target dependencies:
.target(
name: "YourTarget",
dependencies: [
.product(name: "WebAPIs", package: "web-apis")
]
)import WebAPIs
// Use Web APIs in Swift WebAssembly
let console = Console()
console.log("Hello from Swift WebAssembly!")
// Work with CSS properties
let style = CSSStyleDeclaration()
style.setProperty("color", value: "red")- Swift 6.2+
- Swift SDK for WebAssembly
Apache License 2.0 - See LICENSE for details
Contributions welcome! Please open an issue or submit a pull request.
- design-tokens - Universal design tokens based on Apple HIG
- diff-engine - Platform-agnostic character-level diff engine
- embedded-swift-utilities - Utility functions for Embedded Swift environments
- artifact-core - IIIF Presentation API v3 types + deep zoom viewer
- markdown-utilities - Markdown rendering with media attribution support
- admin-core - Core admin functionalities for web applications
- web-builders - HTML, CSS, JS, and SVG DSL builders
- web-components - Reusable UI components for web applications
- web-formats - Structured data format builders
- web-security - Portable security utilities for web applications
- web-types - Shared web types and design tokens