yorkie-js-sdk

Home > yorkie-js-sdk

yorkie-js-sdk package

Classes

Class Description
Change Change represents a unit of modification in the document.
Client Client is a normal client that can communicate with the server. It has documents and sends changes of the documents in local to the server to synchronize with other replicas in remote.
Counter Counter is a custom data type that is used to counter.
Document Document is a CRDT-based data type. We can representing the model of the application. And we can edit it even while offline.
Primitive Primitive represents primitive data type including logical clock. It has a type and a value.
RichText RichText is an extended data type for the contents of a text editor.
Text Text represents text element for representing contents of a text editor.
TimeTicket TimeTicket is a timestamp of the logical clock. Ticket is immutable. It is created by ChangeID.

Enumerations

Enumeration Description
ClientEventType ClientEventType is client event types
ClientStatus ClientStatus is client status types
DocEventType DocEventType is document event types
DocumentSyncResultType DocumentSyncResultType is document sync result types
StreamConnectionStatus StreamConnectionStatus is stream connection status types

Interfaces

Interface Description
ClientOptions ClientOptions are user-settable options used when defining clients.
DocumentsChangedEvent DocumentsChangedEvent is an event that occurs when documents attached to the client changes.
DocumentSyncedEvent DocumentSyncedEvent is an event that occurs when documents attached to the client are synced.
LocalChangeEvent LocalChangeEvent is an event that occurs when the document is changed by local changes.
PeersChangedEvent PeersChangedEvent is an event that occurs when the states of another peers of the attached documents changes.
RemoteChangeEvent RemoteChangeEvent is an event that occurs when the document is changed by remote changes.
SnapshotEvent SnapshotEvent is an event that occurs when a snapshot is received from the server.
StatusChangedEvent StatusChangedEvent is an event that occurs when the Client’s state changes.
StreamConnectionStatusChangedEvent StreamConnectionStatusChangedEvent is an event that occurs when the client’s stream connection state changes.

Variables

Variable Description
converter converter is a converter that converts the given model to protobuf format. is also used to convert models to bytes and vice versa.
yorkie The top-level yorkie namespace with additional properties.In production, this will be called exactly once and the result assigned to the yorkie global.e.g) new yorkie.Client(...);

Type Aliases

Type Alias Description
ActorID ActorID is used to identify who is making changes to the document. It is hexadecimal string and should be generated by unique value.
ClientEvent ClientEvent is an event that occurs in Client. It can be delivered using Client.subscribe().
DocEvent DocEvent is an event that occurs in Document. It can be delivered using Document.subscribe().
Indexable Indexable key, value
JSONArray JSONArray represents JSON array, but unlike regular JSON, it has time tickets created by a logical clock to resolve conflicts.
JSONElement JSONElement represents the type the user is using.
JSONObject JSONObject represents a JSON object, but unlike regular JSON, it has time tickets created by a logical clock to resolve conflicts.
PresenceInfo PresenceInfo is presence information of this client.
PrimitiveValue PrimitiveValue represents a value of primitive type. Only values of type included in PrimitiveValue can be set to the document.
TextChange TextChange is the value passed as an argument to Text.onChanges(). Text.onChanges() is called when the Text is modified.
WrappedElement WrappedElement is a wrapper of JSONElement that provides getID().