Capability first · transport second

SystemAppearance.js

Reads or applies native appearance, returning an explicit unsupported browser state when no bridge exists.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
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

JavaScript
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

BindingFormDeclaration or signatureParameter syntax
defaultdefault · classclass SystemAppearance
CallableKindExact public signatureParameter syntax
SystemAppearance.availablepublic-memberavailable()
SystemAppearance.currentpublic-memberasync current()
SystemAppearance.applypublic-memberasync apply(input={})input={}
MemberKindExact public declarationParameter syntax
SystemAppearance.constructorconstructorconstructor(api=globalThis.Arcane?.appearance||null)api=globalThis.Arcane?.appearance||null
SystemAppearance.availablemethodavailable()
SystemAppearance.currentasync methodasync current()
SystemAppearance.applyasync methodasync 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

JavaScript
import SystemAppearance from '/arcane/modules/SystemAppearance.js';

const appearance = new SystemAppearance();
console.log(await appearance.current());