On this page
Overview
Reads or applies native appearance, returning an explicit unsupported browser state when no bridge exists.
- Artifact
SystemAppearance.js· esm - Classification
public first party - Availability
Browser/native hybrid - Normalization
Absent bridge normalized; native result/error preserved.
Import and lifecycle
import systemAppearance from '/arcane/modules/SystemAppearance.js';
Construction only binds an injected/default bridge. current() and apply() call native methods when present; browser absence becomes an explicit unsupported result.
Application-facing behavior: default SystemAppearance; available(), current(), apply().
Protocol and host implementation
Arcane.appearance This detail does not widen the application-facing API or grant authority.
Exports, signatures, parameters, and results
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
default | default · class | class SystemAppearance | — |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
SystemAppearance.available | public-member | available() | — |
SystemAppearance.current | public-member | async current() | — |
SystemAppearance.apply | public-member | async apply(input={}) | input={} |
| Member | Kind | Exact public declaration | Parameter syntax |
|---|---|---|---|
SystemAppearance.constructor | constructor | constructor(api=globalThis.Arcane?.appearance||null) | api=globalThis.Arcane?.appearance||null |
SystemAppearance.available | method | available() | — |
SystemAppearance.current | async method | async current() | — |
SystemAppearance.apply | async method | async apply(input={}) | input={} |
Parameter meanings and results
new SystemAppearance(api=Arcane.appearance|null); available(); current() resolves the native result or {supported:false,platform:'browser'}; apply({scheme,captionColor?,textColor?}) resolves the native or unsupported result. scheme normalizes to system/light/dark and system clears colors.
Events, side effects, and errors
Source-literal CustomEvent dispatches
No source-literal CustomEvent dispatch is part of this artifact.
Lifecycle and event flow
This artifact has no additional documented lifecycle event flow.
Direct coded failures
This artifact directly assigns no stable coded failure.
Exported Error subclasses
This artifact exports no Error subclass.
Documented failure behavior
- Native provider rejection is preserved; an absent bridge does not throw.
Availability and capabilities
Browser/native hybrid. Absent bridge normalized; native result/error preserved.
appearance.current requires appearance.read; appearance.apply requires appearance.write.
Contract example
import SystemAppearance from '/arcane/modules/SystemAppearance.js';
const appearance = new SystemAppearance();
console.log(await appearance.current());