From 27ab396fd8d9a26c13b18e9372e59d2ff6338230 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Mon, 17 Nov 2025 17:30:26 +0100 Subject: [PATCH] encodeStateAsUpdate returns Uint8Array --- src/utils/encoding.js | 4 ++-- src/utils/updates.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils/encoding.js b/src/utils/encoding.js index d8bf4e87..7f5e3382 100644 --- a/src/utils/encoding.js +++ b/src/utils/encoding.js @@ -494,7 +494,7 @@ export const writeStateAsUpdate = (encoder, doc, targetStateVector = new Map()) * @param {Doc} doc * @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs * @param {UpdateEncoderV1 | UpdateEncoderV2} [encoder] - * @return {Uint8Array} + * @return {Uint8Array} * * @function */ @@ -530,7 +530,7 @@ export const encodeStateAsUpdateV2 = (doc, encodedTargetStateVector = new Uint8A * * @param {Doc} doc * @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs - * @return {Uint8Array} + * @return {Uint8Array} * * @function */ diff --git a/src/utils/updates.js b/src/utils/updates.js index ba6ef59d..292a342c 100644 --- a/src/utils/updates.js +++ b/src/utils/updates.js @@ -180,8 +180,8 @@ export class LazyStructWriter { } /** - * @param {Array} updates - * @return {Uint8Array} + * @param {Array>} updates + * @return {Uint8Array} */ export const mergeUpdates = updates => mergeUpdatesV2(updates, UpdateDecoderV1, UpdateEncoderV1) @@ -325,10 +325,10 @@ const sliceStruct = (left, diff) => { * * This function works similarly to `readUpdateV2`. * - * @param {Array} updates + * @param {Array>} updates * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder] * @param {typeof UpdateEncoderV1 | typeof UpdateEncoderV2} [YEncoder] - * @return {Uint8Array} + * @return {Uint8Array} */ export const mergeUpdatesV2 = (updates, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => { if (updates.length === 1) {