Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs(js): add return type annotations
Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Jan 18, 2024
commit a7b61752474406292e55f6517dc72afc4c18a518
2 changes: 2 additions & 0 deletions src/helpers/yjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { messageSync } from 'y-websocket'
*
* 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 @@ -54,6 +55,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