mirror of
https://github.com/yjs/yjs.git
synced 2025-12-16 03:37:50 +01:00
encodeStateAsUpdate returns Uint8Array<ArrayBuffer>
This commit is contained in:
@@ -494,7 +494,7 @@ export const writeStateAsUpdate = (encoder, doc, targetStateVector = new Map())
|
|||||||
* @param {Doc} doc
|
* @param {Doc} doc
|
||||||
* @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs
|
* @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs
|
||||||
* @param {UpdateEncoderV1 | UpdateEncoderV2} [encoder]
|
* @param {UpdateEncoderV1 | UpdateEncoderV2} [encoder]
|
||||||
* @return {Uint8Array}
|
* @return {Uint8Array<ArrayBuffer>}
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
@@ -530,7 +530,7 @@ export const encodeStateAsUpdateV2 = (doc, encodedTargetStateVector = new Uint8A
|
|||||||
*
|
*
|
||||||
* @param {Doc} doc
|
* @param {Doc} doc
|
||||||
* @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs
|
* @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs
|
||||||
* @return {Uint8Array}
|
* @return {Uint8Array<ArrayBuffer>}
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -180,8 +180,8 @@ export class LazyStructWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array<Uint8Array>} updates
|
* @param {Array<Uint8Array<ArrayBuffer>>} updates
|
||||||
* @return {Uint8Array}
|
* @return {Uint8Array<ArrayBuffer>}
|
||||||
*/
|
*/
|
||||||
export const mergeUpdates = updates => mergeUpdatesV2(updates, UpdateDecoderV1, UpdateEncoderV1)
|
export const mergeUpdates = updates => mergeUpdatesV2(updates, UpdateDecoderV1, UpdateEncoderV1)
|
||||||
|
|
||||||
@@ -325,10 +325,10 @@ const sliceStruct = (left, diff) => {
|
|||||||
*
|
*
|
||||||
* This function works similarly to `readUpdateV2`.
|
* This function works similarly to `readUpdateV2`.
|
||||||
*
|
*
|
||||||
* @param {Array<Uint8Array>} updates
|
* @param {Array<Uint8Array<ArrayBuffer>>} updates
|
||||||
* @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]
|
* @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]
|
||||||
* @param {typeof UpdateEncoderV1 | typeof UpdateEncoderV2} [YEncoder]
|
* @param {typeof UpdateEncoderV1 | typeof UpdateEncoderV2} [YEncoder]
|
||||||
* @return {Uint8Array}
|
* @return {Uint8Array<ArrayBuffer>}
|
||||||
*/
|
*/
|
||||||
export const mergeUpdatesV2 = (updates, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => {
|
export const mergeUpdatesV2 = (updates, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => {
|
||||||
if (updates.length === 1) {
|
if (updates.length === 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user