On this page
Overview
Stores app-scoped, non-secret communication provider preferences.
- Artifact
CommunicationPreferences.js· esm - Classification
public first party - Availability
Browser / native WebView hybrid - Normalization
Normalized preference record; storage failures mixed.
Import and lifecycle
import communicationPreferences from '/arcane/modules/CommunicationPreferences.js';
load reads and save writes one non-secret preference record through Arcane.preferences when available, otherwise app-scoped localStorage.
Application-facing behavior: default CommunicationPreferences; load(), save().
Protocol and host implementation
Arcane.preferences or localStorage 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 CommunicationPreferences | — |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
CommunicationPreferences.load | public-member | async load(defaults={}) | defaults={} |
CommunicationPreferences.save | public-member | async save(values={}) | values={} |
| Member | Kind | Exact public declaration | Parameter syntax |
|---|---|---|---|
CommunicationPreferences.constructor | constructor | constructor(namespace='communications') | namespace='communications' |
CommunicationPreferences.load | async method | async load(defaults={}) | defaults={} |
CommunicationPreferences.save | async method | async save(values={}) | values={} |
Parameter meanings and results
CommunicationPreferences(namespace) derives arcane.communications.<namespace>. load(defaults) merges a stored object over defaults, while save(values) returns a normalized provider map with enabled, endpoint, accountLabel, and status.
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 preference, app-scope, localStorage, and JSON failures propagate
Availability and capabilities
Browser / native WebView hybrid. Normalized preference record; storage failures mixed.
Normalizes native preference storage and browser fallback; it does not store provider credentials or call Core communications.
Contract example
import CommunicationPreferences from '/arcane/modules/CommunicationPreferences.js';
const preferences=new CommunicationPreferences('inbox');
const saved=await preferences.save({
demo:{
enabled:true,
endpoint:'https://bridge.test',
accountLabel:'Work',
status:'Connected'
}
});
console.log(saved.demo);