diff --git a/README.md b/README.md index 4229e25..c7b1047 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,9 @@ Transform must conform to Transform Property 1. That is, apply(apply(snapshot, o - **invert(op) -> op'**: *(optional)* Invert the given operation. The original operation must not be edited in the process. If supplied, apply(apply(snapshot, op), invert(op)) == snapshot. - **normalize(op) -> op'**: *(optional)* Normalize an operation, converting it to a canonical representation. normalize(normalize(op)) == normalize(op). - **transformCursor(cursor, op, isOwnOp) -> cursor'**: *(optional)* transform the specified cursor by the provided operation, so that the cursor moves forward or backward as content is added or removed before (or at) the cursor position. isOwnOp defines how the cursor should be transformed against content inserted *at* the cursor position. If isOwnOp is true, the cursor is moved after the content inserted at the original cursor position. If isOwnOp is false, the cursor remains before the content inserted at the original cursor position. +- **createPresence([initialData]) -> presence**: *(optional)* Creates a valid presence from some initialData. Presence represents a user and may contain details like user ID, cursor position in a text OT type, etc. +- **transformPresence(presence, op, isOwnOp) -> presence'**: *(optional)* Transforms the presence by the op to create a new presence' which is adjusted in some way for the effects of the op. For example, a cursor position may be pushed forward, if the op inserts some text at the beginning of a text document. isOwnOp determines if the operation comes from the owner of the presence, or from another user. +- **comparePresence(presence1, presence2) -> boolean**: *(optional)* Compares presence1 to presence2 and returns true, if they are equal, otherwise returns false. - **serialize(snapshot) -> data**: *(optional)* convert the document snapshot data into a form that may be passed to JSON.stringify. If you have a *serialize* function, you must have a *deserialize* function. - **deserialize(data) -> snapshot**: *(optional)* convert data generated by *serialize* back into its internal snapshot format. deserialize(serialize(snapshot)) == snapshot. If you have a *deserialize* function, you must have a *serialize* function.