The value type stored in the set.
Creates a convergent replicated set from an optional serializable snapshot.
The value type stored in the set.
Optionalsnapshot: CRSetSnapshot<T>A previously emitted CRSet snapshot.
Iterates over detached copies of the current live values.
Emits the current acknowledgement frontier.
Acknowledgement frontiers are used by peers to decide when tombstones can be garbage collected.
Adds a value to the replicated set.
The value's content key is derived from its current canonical MessagePack
encoding. If that key is already visible, the operation is a no-op.
Successful additions emit delta and change events.
Value to add.
Registers an event listener.
The event type to listen for.
The listener to register.
Optionaloptions: boolean | AddEventListenerOptionsListener registration options.
Deletes every visible value.
Successful clears emit delta and change events.
Deletes a value from the replicated set.
The value's content key is derived from its current canonical MessagePack
encoding. If that key is not visible, the operation is a no-op. Successful
deletions emit delta and change events.
Value to delete.
Calls a function once for each live value copy in replica iteration order.
Callback values are detached copies, so mutating them does not mutate the replica.
Function to call for each value.
OptionalthisArg: unknownOptional this value for the callback.
Removes tombstones that every provided frontier has acknowledged.
Replica acknowledgement frontiers.
Checks whether a value is currently visible in the replicated set.
Value to check.
true when the value's current content key is visible.
Applies a remote or local delta to the replica state.
Accepted remote changes may emit change; dominated incoming state may
emit a reply delta.
The partial serialized set state to merge.
Removes an event listener.
The event type to stop listening for.
The listener to remove.
Optionaloptions: boolean | EventListenerOptionsListener removal options.
Emits the current serializable set snapshot.
Returns a serializable snapshot representation of this set.
Called automatically by JSON.stringify.
Attempts to return this set as a JSON string.
Returns detached copies of the current live values.
The current values in replica iteration order.
A convergent replicated set. (set = list without duplicates)
Values are identified by the SHA-256 Base64URL digest of their canonical MessagePack encoding. Local mutations emit
deltaandchangeevents; received deltas converge through merge.Reads and iteration return detached copies of the live values.