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__):
config:{widgetId}— serializedcrate::models::WidgetConfigpending_actions— JSON array ofWidgetActionEnvelope__meta_nonce__/__meta_updated_at__— freshness for multi-transport pick
Structs§
- Widget
Action Envelope - 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 leastfloor + 1.
Type Aliases§
- DataMap
- String key/value bag persisted by transports.