Capability first · transport second

DBLS.js

Provides app-scoped localStorage tables, batch reads/writes, filtering, deletion, and counts.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
On this page

Overview

Provides app-scoped localStorage tables, batch reads/writes, filtering, deletion, and counts.

  • Artifact
    DBLS.js · esm
  • Classification
    public first party
  • Availability
    Browser / native WebView
  • Normalization
    Scoped keys and values normalized; storage failures mixed.

Import and lifecycle

JavaScript
import * as module from '/arcane/modules/DBLS.js';

Browser import installs the app-scoped window.dbls singleton, marks it ready, emits dbls-ready, and CRUD methods synchronously mutate only matching localStorage keys.

Application-facing behavior: default DBLS; installs window.dbls, emits dbls-ready; CRUD/batch/key APIs.

Protocol and host implementation

localStorage + AppDataScope + per-realm globalThis.arcaneEvents authority This detail does not widen the application-facing API or grant authority.

Exports, signatures, parameters, and results

BindingFormDeclaration or signatureParameter syntax
DBLS_EVENT_TYPESvariable · valuevariable DBLS_EVENT_TYPES
DBLS_REASONSvariable · valuevariable DBLS_REASONS
defaultdefault · classclass DBLS
MemberKindExact public declarationParameter syntax
DBLS.constructorconstructorconstructor({ applicationId=null, documentObject=globalThis.document, storage=globalThis.localStorage }={}){ applicationId=null, documentObject=globalThis.document, storage=globalThis.localStorage }={}
DBLS.readyfieldready=false;
DBLS.storageKeymethodstorageKey(key='')key=''
DBLS.logicalKeysmethodlogicalKeys()
DBLS.setmethodset(key='', value)key='', value
DBLS.setManymethodsetMany(items)items
DBLS.getmethodget(key)key
DBLS.getManymethodgetMany(keys=[])keys=[]
DBLS.filterKeyIncludesmethodfilterKeyIncludes(subString='')subString=''
DBLS.getAllmethodgetAll()
DBLS.deletemethoddelete(key)key
DBLS.deleteManymethoddeleteMany(keys)keys
DBLS.clearmethodclear()
DBLS.getAllKeysmethodgetAllKeys()
DBLS.hasKeymethodhasKey(key)key
DBLS.countmethodcount()
DBLS.PUBLISH_DBLS_READYmethod[PUBLISH_DBLS_READY]()

Parameter meanings and results

DBLS(options) offers storageKey, logicalKeys, set, get, setMany, getMany, filterKeyIncludes, getAll, delete, deleteMany, clear, getAllKeys, hasKey, and count. Non-string and non-number values are JSON-serialized, and get attempts JSON parsing.

Events, side effects, and errors

Source-literal CustomEvent dispatches

No source-literal CustomEvent dispatch is part of this artifact.

Lifecycle and event flow

  • dbls-ready

Direct coded failures

  • APP_DATA_STORAGE_UNAVAILABLE

Exported Error subclasses

This artifact exports no Error subclass.

Documented failure behavior

  • APP_DATA_SCOPE_INVALID
  • APP_DATA_SCOPE_MISMATCH
  • APP_DATA_SCOPE_REQUIRED
  • APP_DATA_STORAGE_UNAVAILABLE
  • localStorage and JSON serialization failures

Availability and capabilities

Browser / native WebView. Scoped keys and values normalized; storage failures mixed.

Normalizes browser localStorage to arcane.apps.<id>: keys; native authority is not consulted because this storage API is synchronous.

Contract example

JavaScript
import '/arcane/modules/DBLS.js';

window.dbls.set('settings',{theme:'dark'});
console.log(window.dbls.get('settings'),window.dbls.count());

No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.