Skip to content

Interface: SyncStorageEventMap ​

Defined in: types/desktop-engine.d.ts:4386

DesktopEngine.syncStorage: keys and values (strings) like localStorage's, kept between launches and shared by all the content's instances, that also go to the user's other Macs signed in to the same DesktopEngine account (with the library syncing). Not signed in, they stay on this Mac, and go when the user signs in. They stay in the account when the content is removed from one Mac, and are there again when it's installed again. Content run by desktopengine dev has its own, which stays on the Mac.

Each key is synced on its own: when two Macs change the same key, the change made last wins; changes of different keys never get in each other's way. So keep items that change separately under keys of their own (e.g. a key for each to-do, todo:<id>), rather than one big value. Changes reach the other Macs within seconds, not right away: don't use it for what changes every second.

Limits, over which setItem throws a "QuotaExceededError" DOMException: 1024 items; 1024 × 1024 UTF-16 code units of keys and values together; 61,440 for a key and its value together, as JSON writes them (a ", \ or line break counts 2, another control character 6). Lone surrogates in keys and values become U+FFFD, and keys are stored in Unicode's NFC form: "cafe\u0301" and "caf\u00e9" are the same key.

Items aren't properties (use getItem), and it isn't a Storage.

Properties ​

change ​

ts
change: SyncStorageEvent;

Defined in: types/desktop-engine.d.ts:4387

The SDK is released under the Apache License 2.0