Capability first · transport second

SystemAppearance.js

Reads or applies native appearance, returning an explicit unsupported result when the bridge or optional namespace is absent.

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

JavaScript
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

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() 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

JavaScript
import SystemAppearance from '/node_modules/arcane-os/runtime/arcane/modules/SystemAppearance.js';

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