mirror of
https://github.com/yjs/yjs.git
synced 2026-02-23 19:49:59 +01:00
[updates] createDocFromUpdates accepts DocOpts
This commit is contained in:
@@ -569,7 +569,7 @@ export class DiffAttributionManager extends ObservableV2 {
|
||||
* @param {Doc} prevDoc
|
||||
* @param {Doc} nextDoc
|
||||
* @param {Object} [options] - options for the attribution manager
|
||||
* @param {Attributions?} [options.attrs] - the attributes to apply to the diff
|
||||
* @param {import('./meta.js').ContentMap?} [options.attrs] - the attributes to apply to the diff
|
||||
*/
|
||||
export const createAttributionManagerFromDiff = (prevDoc, nextDoc, options) => new DiffAttributionManager(prevDoc, nextDoc, options)
|
||||
|
||||
|
||||
@@ -785,18 +785,20 @@ export const intersectUpdateWithContentIds = (update, contentIds) =>
|
||||
|
||||
/**
|
||||
* @param {Uint8Array} update
|
||||
* @param {import('./Doc.js').DocOpts} opts
|
||||
*/
|
||||
export const createDocFromUpdate = update => {
|
||||
const ydoc = new Doc()
|
||||
export const createDocFromUpdate = (update, opts = {}) => {
|
||||
const ydoc = new Doc(opts)
|
||||
applyUpdate(ydoc, update)
|
||||
return ydoc
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Uint8Array} update
|
||||
* @param {import('./Doc.js').DocOpts} opts
|
||||
*/
|
||||
export const createDocFromUpdateV2 = update => {
|
||||
const ydoc = new Doc()
|
||||
export const createDocFromUpdateV2 = (update, opts = {}) => {
|
||||
const ydoc = new Doc(opts)
|
||||
applyUpdateV2(ydoc, update)
|
||||
return ydoc
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user