Web API
AIUI provides common Web APIs so developers can handle networking, data, audio, and drawing tasks with familiar JavaScript patterns.
WinterCG Compatibility
AIUI actively embraces and primarily supports the following proposal from WinterCG (Web-interoperable Runtimes Community Group):
- Minimum Common Web API
Developers can use common APIs such as fetch, URL, TextEncoder, TextDecoder, and Web Crypto in AIUI. Check each API page for its exact support; existing Web code may still depend on browser capabilities that AIUI does not implement.
Capability Distribution
To help developers find documentation faster by usage scenario, Web-standard capabilities are no longer grouped under a single subdirectory. Instead, they are organized into categories that are closer to actual business needs:
-
Canvas: See Canvas 2D drawing APIs and image-processing capabilities.
-
Window: Work with the Agent window, its dimensions, Widget opening, and Agent closing.
-
Web Audio: Generate sound, process PCM, adjust volume, and analyse audio.
-
AI: See the relationship between Web Speech capabilities and AI speech capabilities.
-
Device: See perception-related capabilities such as
BarcodeDetector. -
Network: See
fetch,URL, WebSocket, and Streams capabilities. -
Encoding: See text encoding and decoding capabilities such as
TextEncoderandTextDecoder. -
Crypto: See Web Crypto capabilities such as
cryptoandSubtleCrypto. -
Storage: See local persistence through
localStorageand OPFS. -
Console: See standard debugging output APIs.
-
Performance: See runtime performance monitoring capabilities.
-
Permission State: Read permission status and observe changes without prompting.
-
WebAssembly: Load computational modules and bind JavaScript imports and resources.
Recommended Reading
- URL: URL construction, parsing, and query parameter handling.
- Encoding: Text encoding and decoding.
- Crypto: Web Crypto capabilities.
- Storage API: Detailed local storage APIs.
- Web Audio: Web-standard audio processing APIs.
- Streams: Read, write, and transform data in chunks.
- BarcodeDetector: Barcode detection API.
Core Design Principles
AIUI's Web API implementation follows these principles:
- Standards first: Follow WHATWG and W3C standards whenever possible.
- Clear use cases: Each API page explains when to use the capability, its current behavior, and its limits.
- Use only what is needed: Start with the simplest interface for the task, then choose advanced capabilities such as streams or audio processing when necessary.