@mocanvas/sync · interface

CrdtOptions

interface CrdtOptions<R extends UnknownRecord = UnknownRecord>

This one ships without a description. The signature above is read from the package, and the guides cover the area it belongs to.


Properties · 5

clientId: string

Identifies this replica; also the tiebreak in compareStamps.

getRecord?: ((id: string) => R | undefined) | undefined

Read the replica's current value for a record. The CRDT owns the stamps, never the values: the store stays the source of truth and a merge is expressed as a diff against whatever getRecord reports.

now?: (() => number) | undefined

Injectable wall clock, for tests.

tombstoneLimit?: number | undefined

Tombstones kept for records that are gone. Default 5000.

tombstoneMaxAgeMs?: number | undefined

How long such a tombstone lives. Default one hour.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.