Skip to main content

Interface: SyncEngineOptions

Defined in: engine.ts:63

Properties

clock?

optional clock?: SyncClock;

Defined in: engine.ts:69

Timer facility for pollMs; defaults to the platform timers when present.


connectivity?

optional connectivity?: ConnectivityProvider;

Defined in: engine.ts:67


license?

optional license?: LicenseSink;

Defined in: engine.ts:94

The host's LicenseHandle, so a token piggy-backed on any RSP response reaches it (docs/15 §4.4 channel (b), docs/10 §1.3).

Without this the engine only emits licenseRefreshed and something else has to bridge it. @rasd/react's provider does; a Node worker, a native app or <rasd-form> does not, and on those hosts a device that syncs daily would still walk into the grace period with a fresh token sitting unread in a response header. Structural, not the full handle, so @rasd/sync keeps no dependency on @rasd/license.


lockName?

optional lockName?: string;

Defined in: engine.ts:82

Web Locks name used to elect one syncing tab per origin.

Defaults to a single origin-wide name, which is safe in every configuration and over-serialises in a rare one — see DEFAULT_LOCK_NAME. Pass distinct names only when two engines genuinely own separate storage and must run at the same time.


now?

optional now?: () => number;

Defined in: engine.ts:71

Wall clock in ms; injectable so retention and backoff are testable.

Returns

number


policy?

optional policy?: Partial<SyncPolicy>;

Defined in: engine.ts:66


rand?

optional rand?: RandomSource;

Defined in: engine.ts:73

Jitter source for backoff; injectable so retries are deterministic in tests.


storage

storage: StorageAdapter;

Defined in: engine.ts:64


transport

transport: SyncTransport;

Defined in: engine.ts:65