Skip to main content

Module store

Module store 

Source
Expand description

Shared key-value store helpers and action envelopes. Shared storage contract for widget data across platforms.

Keys (breaking in 0.4 — no legacy __widget_config__):

Structs§

WidgetActionEnvelope
Action delivered from a native widget back to the host app.

Constants§

CONFIG_KEY_PREFIX
Key prefix for per-widget UI configs.
META_NONCE_KEY
Monotonic freshness counter written with every map mutation.
META_UPDATED_AT_KEY
Unix epoch milliseconds of last map write.
PENDING_ACTIONS_KEY
Queue of actions emitted by native widgets for the host to consume.

Functions§

config_key
Build the storage key for a widget UI config.
encode_pending_actions
Serialize pending actions for storage.
map_has_config
Whether this map carries at least one config:{widgetId} payload.
map_nonce
Read nonce from a data map (0 if missing/invalid).
map_updated_at
Read updatedAt from a data map (0 if missing/invalid).
now_ms
Current time as Unix ms.
parse_pending_actions
Parse pending actions JSON; empty on missing/invalid.
pick_freshest
Pick the freshest map among candidates.
touch_meta
Bump nonce + updatedAt on the map (call before persisting).
touch_meta_above
Like touch_meta, but the new nonce is at least floor + 1.

Type Aliases§

DataMap
String key/value bag persisted by transports.