Expand description
interface WebxdcProviderOptions<I extends Item = UpdateItem> {
autosaveInterval?: number;
awareness?: Awareness;
getEditInfo: () => EditInfo;
protocol?: Protocol<I>;
realtimeInterval?: number;
webxdc: WebxdcTransport;
ydoc: Doc;
}Properties§
autosave Interval?: numberinterval in milliseconds for automatic publishing of webxdc updates; If not supplied, it defaults to webxdc.sendUpdateInterval, or 10000 if the messaging layer does not expose this information, as per spec.
awareness?: Awarenessthe yjs awareness instance for ephemeral state (cursors, presence). Pass
your own when another component (e.g. an editor binding) already owns it;
otherwise the provider creates a default new Awareness(ydoc). Either way
it is exposed as WebxdcProvider.awareness.
Note that you need to use a protocol that supports awareness like realtimeProtocol in order to propagate awareness information. The default sendAllProtocol does not.
get Edit Info: { ... }a callback that returns display info for each webxdc update
protocol?: Protocol<I>the protocol that decides what to send to chat peers and how it is serialized on the wire.
Defaults to sendAllProtocol, which sends the entire state of the ydoc whenever it changes (larger payloads, but peers stay consistent even over lost messages). The realtimeProtocol is the protocol that adds realtime and awareness behavior over this.
realtime Interval?: numberinterval in milliseconds for flushing the realtime channel, when the protocol has a realtime part and the messaging layer supports realtime. Much shorter than the autosave interval. Defaults to 100.
Note that this only has an effect if you use a protocol that supports realtime, such as realtimeProtocol.
webxdc: WebxdcTransportthe webxdc object from window.webxdc
ydoc: Docthe YJS document to be synchronized
Configuration for WebxdcProvider.