On this page
Overview
Reads or applies native appearance, returning an explicit unsupported result when the bridge or optional namespace is absent.
- Artifact
SystemAppearance.js· esm - Classification
public first party - Availability
Browser/native hybrid - Normalization
Absent bridge keeps its browser result. Exact missing appearance namespace/matching method returns supported:false with the complete original diagnostic; no platform guess or cached absence. Partial-method, permission, transport, cancellation and other genuine errors reject unchanged; available() is callable bridge presence only.
Import and lifecycle
import systemAppearance from '/node_modules/arcane-os/runtime/arcane/modules/SystemAppearance.js';
Construction only binds an injected/default bridge. current() and apply() call native methods when present; absent bridge or exact optional namespace absence becomes an explicit unsupported result. Absence is not cached, so later service registration serves the next operation.
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() reports callable apply presence, not service readiness. current() and apply({scheme,captionColor?,textColor?}) resolve the native result, {supported:false,platform:'browser'} for an absent bridge/method, or {supported:false,reason:'core-namespace-unavailable',error} for exact namespace absence with the complete original diagnostic and no platform guess. 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
- Optional absence requires code:'METHOD_NOT_ALLOWED', reason:'core-namespace-unavailable', namespace:'appearance', and the exact requested appearance.current or appearance.apply method.
- Partial-method absence, older unmarked errors, permission, transport, cancellation and other genuine native failures reject unchanged; absent bridge and exact absent namespace return the documented unsupported result.
Availability and capabilities
Browser/native hybrid. Absent bridge keeps its browser result. Exact missing appearance namespace/matching method returns supported:false with the complete original diagnostic; no platform guess or cached absence. Partial-method, permission, transport, cancellation and other genuine errors reject unchanged; available() is callable bridge presence only.
appearance.current requires appearance.read; appearance.apply requires appearance.write.
Contract example
import SystemAppearance from '/node_modules/arcane-os/runtime/arcane/modules/SystemAppearance.js';
const appearance = new SystemAppearance();
console.log(await appearance.current());