Skip to content
Prev Previous commit
Next Next commit
docs(js): add return type annotations
Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud authored and mejo- committed Jan 29, 2024
commit 8fb238d0891035869e1392c95e478b0fe31d34af
2 changes: 2 additions & 0 deletions src/helpers/yjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { Doc, encodeStateAsUpdate, applyUpdate } from 'yjs'
*
* Used to store yjs state on the server.
* @param {Y.Doc} ydoc - encode state of this doc
* @return {string}
*/
export function getDocumentState(ydoc) {
const update = Y.encodeStateAsUpdate(ydoc)
Expand All @@ -50,6 +51,7 @@ export function applyDocumentState(ydoc, documentState, origin) {
*
* @param {Y.Doc} ydoc - encode state of this doc
* @param {string} encodedBaseUpdate - base64 encoded doc update to build upon
* @return {string|undefined}
*/
export function getUpdateMessage(ydoc, encodedBaseUpdate) {
const baseUpdate = decodeArrayBuffer(encodedBaseUpdate)
Expand Down