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
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
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
DBLS_EVENT_TYPES | variable · value | variable DBLS_EVENT_TYPES | — |
DBLS_REASONS | variable · value | variable DBLS_REASONS | — |
default | default · class | class DBLS | — |
| Member | Kind | Exact public declaration | Parameter syntax |
|---|---|---|---|
DBLS.constructor | constructor | constructor({
applicationId=null,
documentObject=globalThis.document,
storage=globalThis.localStorage
}={}) | {
applicationId=null,
documentObject=globalThis.document,
storage=globalThis.localStorage
}={} |
DBLS.ready | field | ready=false; | — |
DBLS.storageKey | method | storageKey(key='') | key='' |
DBLS.logicalKeys | method | logicalKeys() | — |
DBLS.set | method | set(key='', value) | key='', value |
DBLS.setMany | method | setMany(items) | items |
DBLS.get | method | get(key) | key |
DBLS.getMany | method | getMany(keys=[]) | keys=[] |
DBLS.filterKeyIncludes | method | filterKeyIncludes(subString='') | subString='' |
DBLS.getAll | method | getAll() | — |
DBLS.delete | method | delete(key) | key |
DBLS.deleteMany | method | deleteMany(keys) | keys |
DBLS.clear | method | clear() | — |
DBLS.getAllKeys | method | getAllKeys() | — |
DBLS.hasKey | method | hasKey(key) | key |
DBLS.count | method | count() | — |
DBLS.PUBLISH_DBLS_READY | method | [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
import '/arcane/modules/DBLS.js';
window.dbls.set('settings',{theme:'dark'});
console.log(window.dbls.get('settings'),window.dbls.count());
Related reference
No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.