FRE-600: Fix code review blockers

- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-25 00:08:01 -04:00
parent 65b552bb08
commit 7c684a42cc
48450 changed files with 5679671 additions and 383 deletions

20
node_modules/yjs/dist/src/utils/AbstractConnector.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
/**
* This is an abstract interface that all Connectors should implement to keep them interchangeable.
*
* @note This interface is experimental and it is not advised to actually inherit this class.
* It just serves as typing information.
*
* @extends {ObservableV2<any>}
*/
export class AbstractConnector extends ObservableV2<any> {
/**
* @param {Doc} ydoc
* @param {any} awareness
*/
constructor(ydoc: Doc, awareness: any);
doc: Doc;
awareness: any;
}
import { ObservableV2 } from "lib0/observable";
import { Doc } from "./Doc.js";
//# sourceMappingURL=AbstractConnector.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"AbstractConnector.d.ts","sourceRoot":"","sources":["../../../src/utils/AbstractConnector.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH;IACE;;;OAGG;IACH,kBAHW,GAAG,aACH,GAAG,EAMb;IAFC,SAAe;IACf,eAA0B;CAE7B"}

50
node_modules/yjs/dist/src/utils/DeleteSet.d.ts generated vendored Normal file
View File

@@ -0,0 +1,50 @@
export class DeleteItem {
/**
* @param {number} clock
* @param {number} len
*/
constructor(clock: number, len: number);
/**
* @type {number}
*/
clock: number;
/**
* @type {number}
*/
len: number;
}
/**
* We no longer maintain a DeleteStore. DeleteSet is a temporary object that is created when needed.
* - When created in a transaction, it must only be accessed after sorting, and merging
* - This DeleteSet is send to other clients
* - We do not create a DeleteSet when we send a sync message. The DeleteSet message is created directly from StructStore
* - We read a DeleteSet as part of a sync/update message. In this case the DeleteSet is already sorted and merged.
*/
export class DeleteSet {
/**
* @type {Map<number,Array<DeleteItem>>}
*/
clients: Map<number, Array<DeleteItem>>;
}
export function iterateDeletedStructs(transaction: Transaction, ds: DeleteSet, f: (arg0: GC | Item) => void): void;
export function findIndexDS(dis: Array<DeleteItem>, clock: number): number | null;
export function isDeleted(ds: DeleteSet, id: ID): boolean;
export function sortAndMergeDeleteSet(ds: DeleteSet): void;
export function mergeDeleteSets(dss: Array<DeleteSet>): DeleteSet;
export function addToDeleteSet(ds: DeleteSet, client: number, clock: number, length: number): void;
export function createDeleteSet(): DeleteSet;
export function createDeleteSetFromStructStore(ss: StructStore): DeleteSet;
export function writeDeleteSet(encoder: DSEncoderV1 | DSEncoderV2, ds: DeleteSet): void;
export function readDeleteSet(decoder: DSDecoderV1 | DSDecoderV2): DeleteSet;
export function readAndApplyDeleteSet(decoder: DSDecoderV1 | DSDecoderV2, transaction: Transaction, store: StructStore): Uint8Array | null;
export function equalDeleteSets(ds1: DeleteSet, ds2: DeleteSet): boolean;
import { Transaction } from "./Transaction.js";
import { GC } from "../structs/GC.js";
import { Item } from "../structs/Item.js";
import { ID } from "./ID.js";
import { StructStore } from "./StructStore.js";
import { DSEncoderV1 } from "./UpdateEncoder.js";
import { DSEncoderV2 } from "./UpdateEncoder.js";
import { DSDecoderV1 } from "./UpdateDecoder.js";
import { DSDecoderV2 } from "./UpdateDecoder.js";
//# sourceMappingURL=DeleteSet.d.ts.map

1
node_modules/yjs/dist/src/utils/DeleteSet.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"DeleteSet.d.ts","sourceRoot":"","sources":["../../../src/utils/DeleteSet.js"],"names":[],"mappings":"AAeA;IACE;;;OAGG;IACH,mBAHW,MAAM,OACN,MAAM,EAWhB;IARC;;OAEG;IACH,OAFU,MAAM,CAEE;IAClB;;OAEG;IACH,KAFU,MAAM,CAEF;CAEjB;AAED;;;;;;GAMG;AACH;IAEI;;OAEG;IACH,SAFU,IAAI,MAAM,EAAC,MAAM,UAAU,CAAC,CAAC,CAEf;CAE3B;AAWM,mDANI,WAAW,MACX,SAAS,YACA,EAAE,GAAC,IAAI,KAAE,IAAI,QAc7B;AAUG,iCAPI,MAAM,UAAU,CAAC,SACjB,MAAM,GACL,MAAM,GAAC,IAAI,CAsBtB;AAUM,8BAPI,SAAS,MACT,EAAE,GACD,OAAO,CAQlB;AAQM,0CALI,SAAS,QA2BnB;AAMM,qCAHI,MAAM,SAAS,CAAC,GACf,SAAS,CAsBpB;AAWM,mCARI,SAAS,UACT,MAAM,SACN,MAAM,UACN,MAAM,QAOhB;AAEM,6CAA6C;AAS7C,mDANI,WAAW,GACV,SAAS,CA8BpB;AASM,wCANI,WAAW,GAAG,WAAW,MACzB,SAAS,QAsBnB;AASM,uCANI,WAAW,GAAG,WAAW,GACxB,SAAS,CAoBpB;AAeM,+CARI,WAAW,GAAG,WAAW,eACzB,WAAW,SACX,WAAW,GACV,UAAU,GAAC,IAAI,CA2D1B;AAMM,qCAHI,SAAS,OACT,SAAS,WAgBnB"}

250
node_modules/yjs/dist/src/utils/Doc.d.ts generated vendored Normal file
View File

@@ -0,0 +1,250 @@
export const generateNewClientId: typeof random.uint32;
/**
* @typedef {Object} DocOpts
* @property {boolean} [DocOpts.gc=true] Disable garbage collection (default: gc=true)
* @property {function(Item):boolean} [DocOpts.gcFilter] Will be called before an Item is garbage collected. Return false to keep the Item.
* @property {string} [DocOpts.guid] Define a globally unique identifier for this document
* @property {string | null} [DocOpts.collectionid] Associate this document with a collection. This only plays a role if your provider has a concept of collection.
* @property {any} [DocOpts.meta] Any kind of meta information you want to associate with this document. If this is a subdocument, remote peers will store the meta information as well.
* @property {boolean} [DocOpts.autoLoad] If a subdocument, automatically load document. If this is a subdocument, remote peers will load the document as well automatically.
* @property {boolean} [DocOpts.shouldLoad] Whether the document should be synced by the provider now. This is toggled to true when you call ydoc.load()
*/
/**
* @typedef {Object} DocEvents
* @property {function(Doc):void} DocEvents.destroy
* @property {function(Doc):void} DocEvents.load
* @property {function(boolean, Doc):void} DocEvents.sync
* @property {function(Uint8Array, any, Doc, Transaction):void} DocEvents.update
* @property {function(Uint8Array, any, Doc, Transaction):void} DocEvents.updateV2
* @property {function(Doc):void} DocEvents.beforeAllTransactions
* @property {function(Transaction, Doc):void} DocEvents.beforeTransaction
* @property {function(Transaction, Doc):void} DocEvents.beforeObserverCalls
* @property {function(Transaction, Doc):void} DocEvents.afterTransaction
* @property {function(Transaction, Doc):void} DocEvents.afterTransactionCleanup
* @property {function(Doc, Array<Transaction>):void} DocEvents.afterAllTransactions
* @property {function({ loaded: Set<Doc>, added: Set<Doc>, removed: Set<Doc> }, Doc, Transaction):void} DocEvents.subdocs
*/
/**
* A Yjs instance handles the state of shared data.
* @extends ObservableV2<DocEvents>
*/
export class Doc extends ObservableV2<DocEvents> {
/**
* @param {DocOpts} opts configuration
*/
constructor({ guid, collectionid, gc, gcFilter, meta, autoLoad, shouldLoad }?: DocOpts);
gc: boolean;
gcFilter: (arg0: Item) => boolean;
clientID: number;
guid: string;
collectionid: string | null;
/**
* @type {Map<string, AbstractType<YEvent<any>>>}
*/
share: Map<string, AbstractType<YEvent<any>>>;
store: StructStore;
/**
* @type {Transaction | null}
*/
_transaction: Transaction | null;
/**
* @type {Array<Transaction>}
*/
_transactionCleanups: Array<Transaction>;
/**
* @type {Set<Doc>}
*/
subdocs: Set<Doc>;
/**
* If this document is a subdocument - a document integrated into another document - then _item is defined.
* @type {Item?}
*/
_item: Item | null;
shouldLoad: boolean;
autoLoad: boolean;
meta: any;
/**
* This is set to true when the persistence provider loaded the document from the database or when the `sync` event fires.
* Note that not all providers implement this feature. Provider authors are encouraged to fire the `load` event when the doc content is loaded from the database.
*
* @type {boolean}
*/
isLoaded: boolean;
/**
* This is set to true when the connection provider has successfully synced with a backend.
* Note that when using peer-to-peer providers this event may not provide very useful.
* Also note that not all providers implement this feature. Provider authors are encouraged to fire
* the `sync` event when the doc has been synced (with `true` as a parameter) or if connection is
* lost (with false as a parameter).
*/
isSynced: boolean;
isDestroyed: boolean;
/**
* Promise that resolves once the document has been loaded from a persistence provider.
*/
whenLoaded: Promise<any>;
whenSynced: Promise<any>;
/**
* Notify the parent document that you request to load data into this subdocument (if it is a subdocument).
*
* `load()` might be used in the future to request any provider to load the most current data.
*
* It is safe to call `load()` multiple times.
*/
load(): void;
getSubdocs(): Set<Doc>;
getSubdocGuids(): Set<string>;
/**
* Changes that happen inside of a transaction are bundled. This means that
* the observer fires _after_ the transaction is finished and that all changes
* that happened inside of the transaction are sent as one message to the
* other peers.
*
* @template T
* @param {function(Transaction):T} f The function that should be executed as a transaction
* @param {any} [origin] Origin of who started the transaction. Will be stored on transaction.origin
* @return T
*
* @public
*/
public transact<T>(f: (arg0: Transaction) => T, origin?: any): T;
/**
* Define a shared data type.
*
* Multiple calls of `ydoc.get(name, TypeConstructor)` yield the same result
* and do not overwrite each other. I.e.
* `ydoc.get(name, Y.Array) === ydoc.get(name, Y.Array)`
*
* After this method is called, the type is also available on `ydoc.share.get(name)`.
*
* *Best Practices:*
* Define all types right after the Y.Doc instance is created and store them in a separate object.
* Also use the typed methods `getText(name)`, `getArray(name)`, ..
*
* @template {typeof AbstractType<any>} Type
* @example
* const ydoc = new Y.Doc(..)
* const appState = {
* document: ydoc.getText('document')
* comments: ydoc.getArray('comments')
* }
*
* @param {string} name
* @param {Type} TypeConstructor The constructor of the type definition. E.g. Y.Text, Y.Array, Y.Map, ...
* @return {InstanceType<Type>} The created type. Constructed with TypeConstructor
*
* @public
*/
public get<Type extends {
new (): AbstractType<any>;
}>(name: string, TypeConstructor?: Type): InstanceType<Type>;
/**
* @template T
* @param {string} [name]
* @return {YArray<T>}
*
* @public
*/
public getArray<T_1>(name?: string | undefined): YArray<T_1>;
/**
* @param {string} [name]
* @return {YText}
*
* @public
*/
public getText(name?: string | undefined): YText;
/**
* @template T
* @param {string} [name]
* @return {YMap<T>}
*
* @public
*/
public getMap<T_2>(name?: string | undefined): YMap<T_2>;
/**
* @param {string} [name]
* @return {YXmlElement}
*
* @public
*/
public getXmlElement(name?: string | undefined): YXmlElement;
/**
* @param {string} [name]
* @return {YXmlFragment}
*
* @public
*/
public getXmlFragment(name?: string | undefined): YXmlFragment;
/**
* Converts the entire document into a js object, recursively traversing each yjs type
* Doesn't log types that have not been defined (using ydoc.getType(..)).
*
* @deprecated Do not use this method and rather call toJSON directly on the shared types.
*
* @return {Object<string, any>}
*/
toJSON(): {
[x: string]: any;
};
}
export type DocOpts = {
/**
* Disable garbage collection (default: gc=true)
*/
gc?: boolean | undefined;
/**
* Will be called before an Item is garbage collected. Return false to keep the Item.
*/
gcFilter?: ((arg0: Item) => boolean) | undefined;
/**
* Define a globally unique identifier for this document
*/
guid?: string | undefined;
/**
* Associate this document with a collection. This only plays a role if your provider has a concept of collection.
*/
collectionid?: string | null | undefined;
/**
* Any kind of meta information you want to associate with this document. If this is a subdocument, remote peers will store the meta information as well.
*/
meta?: any;
/**
* If a subdocument, automatically load document. If this is a subdocument, remote peers will load the document as well automatically.
*/
autoLoad?: boolean | undefined;
/**
* Whether the document should be synced by the provider now. This is toggled to true when you call ydoc.load()
*/
shouldLoad?: boolean | undefined;
};
export type DocEvents = {
destroy: (arg0: Doc) => void;
load: (arg0: Doc) => void;
sync: (arg0: boolean, arg1: Doc) => void;
update: (arg0: Uint8Array, arg1: any, arg2: Doc, arg3: Transaction) => void;
updateV2: (arg0: Uint8Array, arg1: any, arg2: Doc, arg3: Transaction) => void;
beforeAllTransactions: (arg0: Doc) => void;
beforeTransaction: (arg0: Transaction, arg1: Doc) => void;
beforeObserverCalls: (arg0: Transaction, arg1: Doc) => void;
afterTransaction: (arg0: Transaction, arg1: Doc) => void;
afterTransactionCleanup: (arg0: Transaction, arg1: Doc) => void;
afterAllTransactions: (arg0: Doc, arg1: Array<Transaction>) => void;
subdocs: (arg0: {
loaded: Set<Doc>;
added: Set<Doc>;
removed: Set<Doc>;
}, arg1: Doc, arg2: Transaction) => void;
};
import * as random from "lib0/random";
import { ObservableV2 } from "lib0/observable";
import { Item } from "../structs/Item.js";
import { AbstractType } from "../types/AbstractType.js";
import { YEvent } from "./YEvent.js";
import { StructStore } from "./StructStore.js";
import { Transaction } from "./Transaction.js";
import { YArray } from "../types/YArray.js";
import { YText } from "../types/YText.js";
import { YMap } from "../types/YMap.js";
import { YXmlElement } from "../types/YXmlElement.js";
import { YXmlFragment } from "../types/YXmlFragment.js";
//# sourceMappingURL=Doc.d.ts.map

1
node_modules/yjs/dist/src/utils/Doc.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Doc.d.ts","sourceRoot":"","sources":["../../../src/utils/Doc.js"],"names":[],"mappings":"AAsBA,uDAAgD;AAEhD;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;GAcG;AAEH;;;GAGG;AACH;IACE;;OAEG;IACH,+EAFW,OAAO,EAsFjB;IAlFC,YAAY;IACZ,iBAnCmB,IAAI,KAAE,OAAO,CAmCR;IACxB,iBAAqC;IACrC,aAAgB;IAChB,4BAAgC;IAChC;;OAEG;IACH,OAFU,IAAI,MAAM,EAAE,aAAa,OAAO,GAAG,CAAC,CAAC,CAAC,CAE1B;IACtB,mBAA8B;IAC9B;;OAEG;IACH,cAFU,WAAW,GAAG,IAAI,CAEJ;IACxB;;OAEG;IACH,sBAFU,MAAM,WAAW,CAAC,CAEE;IAC9B;;OAEG;IACH,SAFU,IAAI,GAAG,CAAC,CAEM;IACxB;;;OAGG;IACH,OAFU,IAAI,QAEG;IACjB,oBAA4B;IAC5B,kBAAwB;IACxB,UAAgB;IAChB;;;;;OAKG;IACH,UAFU,OAAO,CAEI;IACrB;;;;;;OAMG;IACH,kBAAqB;IACrB,qBAAwB;IACxB;;OAEG;IACH,yBAKE;IAeE,yBAAwC;IAe9C;;;;;;OAMG;IACH,aAQC;IAED,uBAEC;IAED,8BAEC;IAED;;;;;;;;;;;;OAYG;IACH,6BANoB,WAAW,iBACpB,GAAG,KAOb;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH;;aANW,MAAM,8CAsChB;IAED;;;;;;OAMG;IACH,6DAEC;IAED;;;;;OAKG;IACH,2CAJY,KAAK,CAMhB;IAED;;;;;;OAMG;IACH,yDAEC;IAED;;;;;OAKG;IACH,iDAJY,WAAW,CAMtB;IAED;;;;;OAKG;IACH,kDAJY,YAAY,CAMvB;IAED;;;;;;;OAOG;IACH;YAFmB,MAAM,GAAE,GAAG;MAa7B;CA2BF;;;;;;;;;uBA/TsB,IAAI,KAAE,OAAO;;;;;;;;;;;;WAGtB,GAAG;;;;;;;;;;;oBAOM,GAAG,KAAE,IAAI;iBACT,GAAG,KAAE,IAAI;iBACT,OAAO,QAAE,GAAG,KAAE,IAAI;mBAClB,UAAU,QAAE,GAAG,QAAE,GAAG,QAAE,WAAW,KAAE,IAAI;qBACvC,UAAU,QAAE,GAAG,QAAE,GAAG,QAAE,WAAW,KAAE,IAAI;kCACvC,GAAG,KAAE,IAAI;8BACT,WAAW,QAAE,GAAG,KAAE,IAAI;gCACtB,WAAW,QAAE,GAAG,KAAE,IAAI;6BACtB,WAAW,QAAE,GAAG,KAAE,IAAI;oCACtB,WAAW,QAAE,GAAG,KAAE,IAAI;iCACtB,GAAG,QAAE,MAAM,WAAW,CAAC,KAAE,IAAI;oBAC7B;QAAE,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC;QAAC,KAAK,EAAE,IAAI,GAAG,CAAC,CAAC;QAAC,OAAO,EAAE,IAAI,GAAG,CAAC,CAAA;KAAE,QAAE,GAAG,QAAE,WAAW,KAAE,IAAI"}

19
node_modules/yjs/dist/src/utils/EventHandler.d.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
/**
* General event handler implementation.
*
* @template ARG0, ARG1
*
* @private
*/
export class EventHandler<ARG0, ARG1> {
/**
* @type {Array<function(ARG0, ARG1):void>}
*/
l: ((arg0: ARG0, arg1: ARG1) => void)[];
}
export function createEventHandler<ARG0, ARG1>(): EventHandler<ARG0, ARG1>;
export function addEventHandlerListener<ARG0, ARG1>(eventHandler: EventHandler<ARG0, ARG1>, f: (arg0: ARG0, arg1: ARG1) => void): number;
export function removeEventHandlerListener<ARG0, ARG1>(eventHandler: EventHandler<ARG0, ARG1>, f: (arg0: ARG0, arg1: ARG1) => void): void;
export function removeAllEventHandlerListeners<ARG0, ARG1>(eventHandler: EventHandler<ARG0, ARG1>): void;
export function callEventHandlerListeners<ARG0, ARG1>(eventHandler: EventHandler<ARG0, ARG1>, arg0: ARG0, arg1: ARG1): void;
//# sourceMappingURL=EventHandler.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"EventHandler.d.ts","sourceRoot":"","sources":["../../../src/utils/EventHandler.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH;IAEI;;OAEG;IACH,WAFyB,IAAI,QAAE,IAAI,KAAE,IAAI,IAE9B;CAEd;AASM,2EAAmD;AAanD,2HALwB,IAAI,UAMX;AAajB,8HANwB,IAAI,QAalC;AAUM,yGAEN;AAcM,4HACkC"}

26
node_modules/yjs/dist/src/utils/ID.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
export class ID {
/**
* @param {number} client client id
* @param {number} clock unique per client id, continuous number
*/
constructor(client: number, clock: number);
/**
* Client id
* @type {number}
*/
client: number;
/**
* unique per client id, continuous number
* @type {number}
*/
clock: number;
}
export function compareIDs(a: ID | null, b: ID | null): boolean;
export function createID(client: number, clock: number): ID;
export function writeID(encoder: encoding.Encoder, id: ID): void;
export function readID(decoder: decoding.Decoder): ID;
export function findRootTypeKey(type: AbstractType<any>): string;
import * as encoding from "lib0/encoding";
import * as decoding from "lib0/decoding";
import { AbstractType } from "../types/AbstractType.js";
//# sourceMappingURL=ID.d.ts.map

1
node_modules/yjs/dist/src/utils/ID.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ID.d.ts","sourceRoot":"","sources":["../../../src/utils/ID.js"],"names":[],"mappings":"AAMA;IACE;;;OAGG;IACH,oBAHW,MAAM,SACN,MAAM,EAahB;IAVC;;;OAGG;IACH,QAFU,MAAM,CAEI;IACpB;;;OAGG;IACH,OAFU,MAAM,CAEE;CAErB;AASM,8BANI,EAAE,GAAG,IAAI,KACT,EAAE,GAAG,IAAI,GACR,OAAO,CAIsG;AASlH,iCANI,MAAM,SACN,MAAM,MAK+C;AASzD,iCANI,SAAS,OAAO,MAChB,EAAE,QAQZ;AAaM,gCANI,SAAS,OAAO,GACf,EAAE,CAM0D;AAajE,sCANI,aAAa,GAAG,CAAC,GAChB,MAAM,CAajB"}

42
node_modules/yjs/dist/src/utils/PermanentUserData.d.ts generated vendored Normal file
View File

@@ -0,0 +1,42 @@
export class PermanentUserData {
/**
* @param {Doc} doc
* @param {YMap<any>} [storeType]
*/
constructor(doc: Doc, storeType?: YMap<any> | undefined);
yusers: YMap<any>;
doc: Doc;
/**
* Maps from clientid to userDescription
*
* @type {Map<number,string>}
*/
clients: Map<number, string>;
dss: Map<string, DeleteSet>;
/**
* @param {Doc} doc
* @param {number} clientid
* @param {string} userDescription
* @param {Object} conf
* @param {function(Transaction, DeleteSet):boolean} [conf.filter]
*/
setUserMapping(doc: Doc, clientid: number, userDescription: string, { filter }?: {
filter?: ((arg0: Transaction, arg1: DeleteSet) => boolean) | undefined;
}): void;
/**
* @param {number} clientid
* @return {any}
*/
getUserByClientId(clientid: number): any;
/**
* @param {ID} id
* @return {string | null}
*/
getUserByDeletedId(id: ID): string | null;
}
import { YMap } from "../types/YMap.js";
import { Doc } from "./Doc.js";
import { DeleteSet } from "./DeleteSet.js";
import { Transaction } from "./Transaction.js";
import { ID } from "./ID.js";
//# sourceMappingURL=PermanentUserData.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"PermanentUserData.d.ts","sourceRoot":"","sources":["../../../src/utils/PermanentUserData.js"],"names":[],"mappings":"AAaA;IACE;;;OAGG;IACH,iBAHW,GAAG,qCAmDb;IA3CC,kBAAuB;IACvB,SAAc;IACd;;;;OAIG;IACH,SAFU,IAAI,MAAM,EAAC,MAAM,CAAC,CAEJ;IACxB,4BAAc;IAqChB;;;;;;OAMG;IACH,oBANW,GAAG,YACH,MAAM,mBACN,MAAM;QAE0C,MAAM,WAA7C,WAAW,QAAE,SAAS,KAAE,OAAO;aA6ClD;IAED;;;OAGG;IACH,4BAHW,MAAM,GACL,GAAG,CAId;IAED;;;OAGG;IACH,uBAHW,EAAE,GACD,MAAM,GAAG,IAAI,CASxB;CACF"}

91
node_modules/yjs/dist/src/utils/RelativePosition.d.ts generated vendored Normal file
View File

@@ -0,0 +1,91 @@
/**
* A relative position is based on the Yjs model and is not affected by document changes.
* E.g. If you place a relative position before a certain character, it will always point to this character.
* If you place a relative position at the end of a type, it will always point to the end of the type.
*
* A numeric position is often unsuited for user selections, because it does not change when content is inserted
* before or after.
*
* ```Insert(0, 'x')('a|bc') = 'xa|bc'``` Where | is the relative position.
*
* One of the properties must be defined.
*
* @example
* // Current cursor position is at position 10
* const relativePosition = createRelativePositionFromIndex(yText, 10)
* // modify yText
* yText.insert(0, 'abc')
* yText.delete(3, 10)
* // Compute the cursor position
* const absolutePosition = createAbsolutePositionFromRelativePosition(y, relativePosition)
* absolutePosition.type === yText // => true
* console.log('cursor location is ' + absolutePosition.index) // => cursor location is 3
*
*/
export class RelativePosition {
/**
* @param {ID|null} type
* @param {string|null} tname
* @param {ID|null} item
* @param {number} assoc
*/
constructor(type: ID | null, tname: string | null, item: ID | null, assoc?: number);
/**
* @type {ID|null}
*/
type: ID | null;
/**
* @type {string|null}
*/
tname: string | null;
/**
* @type {ID | null}
*/
item: ID | null;
/**
* A relative position is associated to a specific character. By default
* assoc >= 0, the relative position is associated to the character
* after the meant position.
* I.e. position 1 in 'ab' is associated to character 'b'.
*
* If assoc < 0, then the relative position is associated to the character
* before the meant position.
*
* @type {number}
*/
assoc: number;
}
export function relativePositionToJSON(rpos: RelativePosition): any;
export function createRelativePositionFromJSON(json: any): RelativePosition;
export class AbsolutePosition {
/**
* @param {AbstractType<any>} type
* @param {number} index
* @param {number} [assoc]
*/
constructor(type: AbstractType<any>, index: number, assoc?: number | undefined);
/**
* @type {AbstractType<any>}
*/
type: AbstractType<any>;
/**
* @type {number}
*/
index: number;
assoc: number;
}
export function createAbsolutePosition(type: AbstractType<any>, index: number, assoc?: number | undefined): AbsolutePosition;
export function createRelativePosition(type: AbstractType<any>, item: ID | null, assoc?: number | undefined): RelativePosition;
export function createRelativePositionFromTypeIndex(type: AbstractType<any>, index: number, assoc?: number | undefined): RelativePosition;
export function writeRelativePosition(encoder: encoding.Encoder, rpos: RelativePosition): encoding.Encoder;
export function encodeRelativePosition(rpos: RelativePosition): Uint8Array;
export function readRelativePosition(decoder: decoding.Decoder): RelativePosition;
export function decodeRelativePosition(uint8Array: Uint8Array): RelativePosition;
export function createAbsolutePositionFromRelativePosition(rpos: RelativePosition, doc: Doc, followUndoneDeletions?: boolean): AbsolutePosition | null;
export function compareRelativePositions(a: RelativePosition | null, b: RelativePosition | null): boolean;
import { ID } from "./ID.js";
import { AbstractType } from "../types/AbstractType.js";
import * as encoding from "lib0/encoding";
import * as decoding from "lib0/decoding";
import { Doc } from "./Doc.js";
//# sourceMappingURL=RelativePosition.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"RelativePosition.d.ts","sourceRoot":"","sources":["../../../src/utils/RelativePosition.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;IACE;;;;;OAKG;IACH,kBALW,EAAE,GAAC,IAAI,SACP,MAAM,GAAC,IAAI,QACX,EAAE,GAAC,IAAI,UACP,MAAM,EA2BhB;IAxBC;;OAEG;IACH,MAFU,EAAE,GAAC,IAAI,CAED;IAChB;;OAEG;IACH,OAFU,MAAM,GAAC,IAAI,CAEH;IAClB;;OAEG;IACH,MAFU,EAAE,GAAG,IAAI,CAEH;IAChB;;;;;;;;;;OAUG;IACH,OAFU,MAAM,CAEE;CAErB;AAMM,6CAHI,gBAAgB,GACf,GAAG,CAiBd;AAQM,qDALI,GAAG,GACF,gBAAgB,CAIuP;AAEnR;IACE;;;;OAIG;IACH,kBAJW,aAAa,GAAG,CAAC,SACjB,MAAM,8BAahB;IATC;;OAEG;IACH,MAFU,aAAa,GAAG,CAAC,CAEX;IAChB;;OAEG;IACH,OAFU,MAAM,CAEE;IAClB,cAAkB;CAErB;AASM,6CANI,aAAa,GAAG,CAAC,SACjB,MAAM,gDAKyF;AASnG,6CANI,aAAa,GAAG,CAAC,QACjB,EAAE,GAAC,IAAI,gDAcjB;AAYM,0DAPI,aAAa,GAAG,CAAC,SACjB,MAAM,+BAEL,gBAAgB,CA4B3B;AAQM,+CALI,SAAS,OAAO,QAChB,gBAAgB,oBAsB1B;AAMM,6CAHI,gBAAgB,GACf,UAAU,CAMrB;AAQM,8CALI,SAAS,OAAO,GACf,gBAAgB,CAwB3B;AAMM,mDAHI,UAAU,GACT,gBAAgB,CAEgF;AAgCrG,iEAPI,gBAAgB,OAChB,GAAG,0BACH,OAAO,GACN,gBAAgB,GAAC,IAAI,CAyDhC;AASM,4CANI,gBAAgB,GAAC,IAAI,KACrB,gBAAgB,GAAC,IAAI,GACpB,OAAO,CAMlB"}

40
node_modules/yjs/dist/src/utils/Snapshot.d.ts generated vendored Normal file
View File

@@ -0,0 +1,40 @@
export class Snapshot {
/**
* @param {DeleteSet} ds
* @param {Map<number,number>} sv state map
*/
constructor(ds: DeleteSet, sv: Map<number, number>);
/**
* @type {DeleteSet}
*/
ds: DeleteSet;
/**
* State Map
* @type {Map<number,number>}
*/
sv: Map<number, number>;
}
export function equalSnapshots(snap1: Snapshot, snap2: Snapshot): boolean;
export function encodeSnapshotV2(snapshot: Snapshot, encoder?: DSEncoderV1 | DSEncoderV2 | undefined): Uint8Array;
export function encodeSnapshot(snapshot: Snapshot): Uint8Array;
export function decodeSnapshotV2(buf: Uint8Array, decoder?: DSDecoderV1 | DSDecoderV2 | undefined): Snapshot;
export function decodeSnapshot(buf: Uint8Array): Snapshot;
export function createSnapshot(ds: DeleteSet, sm: Map<number, number>): Snapshot;
export const emptySnapshot: Snapshot;
export function snapshot(doc: Doc): Snapshot;
export function isVisible(item: Item, snapshot: Snapshot | undefined): boolean;
export function splitSnapshotAffectedStructs(transaction: Transaction, snapshot: Snapshot): void;
export function createDocFromSnapshot(originDoc: Doc, snapshot: Snapshot, newDoc?: Doc | undefined): Doc;
export function snapshotContainsUpdateV2(snapshot: Snapshot, update: Uint8Array, YDecoder?: typeof UpdateDecoderV1 | typeof UpdateDecoderV2 | undefined): boolean;
export function snapshotContainsUpdate(snapshot: Snapshot, update: Uint8Array): boolean;
import { DeleteSet } from "./DeleteSet.js";
import { DSEncoderV1 } from "./UpdateEncoder.js";
import { DSEncoderV2 } from "./UpdateEncoder.js";
import { DSDecoderV1 } from "./UpdateDecoder.js";
import { DSDecoderV2 } from "./UpdateDecoder.js";
import { Doc } from "./Doc.js";
import { Item } from "../structs/Item.js";
import { Transaction } from "./Transaction.js";
import { UpdateDecoderV1 } from "./UpdateDecoder.js";
import { UpdateDecoderV2 } from "./UpdateDecoder.js";
//# sourceMappingURL=Snapshot.d.ts.map

1
node_modules/yjs/dist/src/utils/Snapshot.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Snapshot.d.ts","sourceRoot":"","sources":["../../../src/utils/Snapshot.js"],"names":[],"mappings":"AA2BA;IACE;;;OAGG;IACH,gBAHW,SAAS,MACT,IAAI,MAAM,EAAC,MAAM,CAAC,EAY5B;IATC;;OAEG;IACH,IAFU,SAAS,CAEP;IACZ;;;OAGG;IACH,IAFU,IAAI,MAAM,EAAC,MAAM,CAAC,CAEhB;CAEf;AAOM,sCAJI,QAAQ,SACR,QAAQ,GACP,OAAO,CA6BlB;AAOM,2CAJI,QAAQ,oDAEP,UAAU,CAMrB;AAMM,yCAHI,QAAQ,GACP,UAAU,CAEiE;AAOhF,sCAJI,UAAU,oDAET,QAAQ,CAInB;AAMM,oCAHI,UAAU,GACT,QAAQ,CAEoF;AAOjG,mCAJI,SAAS,MACT,IAAI,MAAM,EAAC,MAAM,CAAC,GACjB,QAAQ,CAE0C;AAE9D,qCAAyE;AAMlE,8BAHI,GAAG,GACF,QAAQ,CAE+F;AAS5G,gCANI,IAAI,YACJ,QAAQ,GAAC,SAAS,WAOoG;AAM1H,0DAHI,WAAW,YACX,QAAQ,QAelB;AAgBM,iDALI,GAAG,YACH,QAAQ,6BAEP,GAAG,CA0Cd;AAOM,mDAJI,QAAQ,UACR,UAAU,mFAepB;AAMM,iDAHI,QAAQ,UACR,UAAU,WAEkG"}

34
node_modules/yjs/dist/src/utils/StructStore.d.ts generated vendored Normal file
View File

@@ -0,0 +1,34 @@
export class StructStore {
/**
* @type {Map<number,Array<GC|Item>>}
*/
clients: Map<number, Array<GC | Item>>;
/**
* @type {null | { missing: Map<number, number>, update: Uint8Array }}
*/
pendingStructs: {
missing: Map<number, number>;
update: Uint8Array;
} | null;
/**
* @type {null | Uint8Array}
*/
pendingDs: null | Uint8Array;
}
export function getStateVector(store: StructStore): Map<number, number>;
export function getState(store: StructStore, client: number): number;
export function integrityCheck(store: StructStore): void;
export function addStruct(store: StructStore, struct: GC | Item): void;
export function findIndexSS(structs: Array<Item | GC>, clock: number): number;
export function find(store: StructStore, id: ID): GC | Item;
export function getItem(arg0: StructStore, arg1: ID): Item;
export function findIndexCleanStart(transaction: Transaction, structs: Array<Item | GC>, clock: number): number;
export function getItemCleanStart(transaction: Transaction, id: ID): Item;
export function getItemCleanEnd(transaction: Transaction, store: StructStore, id: ID): Item;
export function replaceStruct(store: StructStore, struct: GC | Item, newStruct: GC | Item): void;
export function iterateStructs(transaction: Transaction, structs: Array<Item | GC>, clockStart: number, len: number, f: (arg0: GC | Item) => void): void;
import { GC } from "../structs/GC.js";
import { Item } from "../structs/Item.js";
import { ID } from "./ID.js";
import { Transaction } from "./Transaction.js";
//# sourceMappingURL=StructStore.d.ts.map

1
node_modules/yjs/dist/src/utils/StructStore.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"StructStore.d.ts","sourceRoot":"","sources":["../../../src/utils/StructStore.js"],"names":[],"mappings":"AASA;IAEI;;OAEG;IACH,SAFU,IAAI,MAAM,EAAC,MAAM,EAAE,GAAC,IAAI,CAAC,CAAC,CAEZ;IACxB;;OAEG;IACH;iBAF4B,IAAI,MAAM,EAAE,MAAM,CAAC;gBAAU,UAAU;aAEzC;IAC1B;;OAEG;IACH,WAFU,IAAI,GAAG,UAAU,CAEN;CAExB;AAYM,sCANI,WAAW,GACV,IAAI,MAAM,EAAC,MAAM,CAAC,CAY7B;AAUM,gCAPI,WAAW,UACX,MAAM,GACL,MAAM,CAYjB;AAQM,sCALI,WAAW,QAerB;AASM,iCANI,WAAW,UACX,EAAE,GAAC,IAAI,QAiBjB;AAWM,qCAPI,MAAM,IAAI,GAAC,EAAE,CAAC,SACd,MAAM,GACL,MAAM,CAiCjB;AAYM,4BAPI,WAAW,MACX,EAAE,GACD,EAAE,GAAC,IAAI,CAYlB;AAOiC,8BAAS,WAAW,QAAC,EAAE,GAAE,IAAI,CAAA;AAOxD,iDAJI,WAAW,WACX,MAAM,IAAI,GAAC,EAAE,CAAC,SACd,MAAM,UAUhB;AAYM,+CAPI,WAAW,MACX,EAAE,GACD,IAAI,CAQf;AAaM,6CARI,WAAW,SACX,WAAW,MACX,EAAE,GACD,IAAI,CAiBf;AAWM,qCAPI,WAAW,UACX,EAAE,GAAC,IAAI,aACP,EAAE,GAAC,IAAI,QAQjB;AAaM,4CARI,WAAW,WACX,MAAM,IAAI,GAAC,EAAE,CAAC,cACd,MAAM,OACN,MAAM,YACG,EAAE,GAAC,IAAI,KAAE,IAAI,QAkBhC"}

115
node_modules/yjs/dist/src/utils/Transaction.d.ts generated vendored Normal file
View File

@@ -0,0 +1,115 @@
/**
* A transaction is created for every change on the Yjs model. It is possible
* to bundle changes on the Yjs model in a single transaction to
* minimize the number on messages sent and the number of observer calls.
* If possible the user of this library should bundle as many changes as
* possible. Here is an example to illustrate the advantages of bundling:
*
* @example
* const ydoc = new Y.Doc()
* const map = ydoc.getMap('map')
* // Log content when change is triggered
* map.observe(() => {
* console.log('change triggered')
* })
* // Each change on the map type triggers a log message:
* map.set('a', 0) // => "change triggered"
* map.set('b', 0) // => "change triggered"
* // When put in a transaction, it will trigger the log after the transaction:
* ydoc.transact(() => {
* map.set('a', 1)
* map.set('b', 1)
* }) // => "change triggered"
*
* @public
*/
export class Transaction {
/**
* @param {Doc} doc
* @param {any} origin
* @param {boolean} local
*/
constructor(doc: Doc, origin: any, local: boolean);
/**
* The Yjs instance.
* @type {Doc}
*/
doc: Doc;
/**
* Describes the set of deleted items by ids
* @type {DeleteSet}
*/
deleteSet: DeleteSet;
/**
* Holds the state before the transaction started.
* @type {Map<Number,Number>}
*/
beforeState: Map<number, number>;
/**
* Holds the state after the transaction.
* @type {Map<Number,Number>}
*/
afterState: Map<number, number>;
/**
* All types that were directly modified (property added or child
* inserted/deleted). New types are not included in this Set.
* Maps from type to parentSubs (`item.parentSub = null` for YArray)
* @type {Map<AbstractType<YEvent<any>>,Set<String|null>>}
*/
changed: Map<AbstractType<YEvent<any>>, Set<string | null>>;
/**
* Stores the events for the types that observe also child elements.
* It is mainly used by `observeDeep`.
* @type {Map<AbstractType<YEvent<any>>,Array<YEvent<any>>>}
*/
changedParentTypes: Map<AbstractType<YEvent<any>>, Array<YEvent<any>>>;
/**
* @type {Array<AbstractStruct>}
*/
_mergeStructs: Array<AbstractStruct>;
/**
* @type {any}
*/
origin: any;
/**
* Stores meta information on the transaction
* @type {Map<any,any>}
*/
meta: Map<any, any>;
/**
* Whether this change originates from this doc.
* @type {boolean}
*/
local: boolean;
/**
* @type {Set<Doc>}
*/
subdocsAdded: Set<Doc>;
/**
* @type {Set<Doc>}
*/
subdocsRemoved: Set<Doc>;
/**
* @type {Set<Doc>}
*/
subdocsLoaded: Set<Doc>;
/**
* @type {boolean}
*/
_needFormattingCleanup: boolean;
}
export function writeUpdateMessageFromTransaction(encoder: UpdateEncoderV1 | UpdateEncoderV2, transaction: Transaction): boolean;
export function nextID(transaction: Transaction): import("./ID.js").ID;
export function addChangedTypeToTransaction(transaction: Transaction, type: AbstractType<YEvent<any>>, parentSub: string | null): void;
export function tryGc(ds: DeleteSet, store: StructStore, gcFilter: (arg0: Item) => boolean): void;
export function transact<T>(doc: Doc, f: (arg0: Transaction) => T, origin?: any, local?: boolean): T;
import { Doc } from "./Doc.js";
import { DeleteSet } from "./DeleteSet.js";
import { AbstractType } from "../types/AbstractType.js";
import { YEvent } from "./YEvent.js";
import { AbstractStruct } from "../structs/AbstractStruct.js";
import { UpdateEncoderV1 } from "./UpdateEncoder.js";
import { UpdateEncoderV2 } from "./UpdateEncoder.js";
import { StructStore } from "./StructStore.js";
import { Item } from "../structs/Item.js";
//# sourceMappingURL=Transaction.d.ts.map

1
node_modules/yjs/dist/src/utils/Transaction.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../../src/utils/Transaction.js"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IACE;;;;OAIG;IACH,iBAJW,GAAG,UACH,GAAG,SACH,OAAO,EAsEjB;IAnEC;;;OAGG;IACH,KAFU,GAAG,CAEC;IACd;;;OAGG;IACH,WAFU,SAAS,CAEa;IAChC;;;OAGG;IACH,aAFU,mBAAkB,CAEgB;IAC5C;;;OAGG;IACH,YAFU,mBAAkB,CAED;IAC3B;;;;;OAKG;IACH,SAFU,IAAI,aAAa,OAAO,GAAG,CAAC,CAAC,EAAC,IAAI,SAAO,IAAI,CAAC,CAAC,CAEjC;IACxB;;;;OAIG;IACH,oBAFU,IAAI,aAAa,OAAO,GAAG,CAAC,CAAC,EAAC,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC,CAExB;IACnC;;OAEG;IACH,eAFU,MAAM,cAAc,CAAC,CAER;IACvB;;OAEG;IACH,QAFU,GAAG,CAEO;IACpB;;;OAGG;IACH,MAFU,IAAI,GAAG,EAAC,GAAG,CAAC,CAED;IACrB;;;OAGG;IACH,OAFU,OAAO,CAEC;IAClB;;OAEG;IACH,cAFU,IAAI,GAAG,CAAC,CAEW;IAC7B;;OAEG;IACH,gBAFU,IAAI,GAAG,CAAC,CAEa;IAC/B;;OAEG;IACH,eAFU,IAAI,GAAG,CAAC,CAEY;IAC9B;;OAEG;IACH,wBAFU,OAAO,CAEkB;CAEtC;AAOM,2DAJI,eAAe,GAAG,eAAe,eACjC,WAAW,GACV,OAAO,CAUlB;AAQM,oCALI,WAAW,wBAQrB;AAUM,yDAJI,WAAW,QACX,aAAa,OAAO,GAAG,CAAC,CAAC,aACzB,MAAM,GAAC,IAAI,QAOrB;AAuFM,0BAJI,SAAS,SACT,WAAW,mBACF,IAAI,KAAE,OAAO,QAKhC;AA8JM,iCAPI,GAAG,YACM,WAAW,iBACpB,GAAG,sBAyCb"}

189
node_modules/yjs/dist/src/utils/UndoManager.d.ts generated vendored Normal file
View File

@@ -0,0 +1,189 @@
export class StackItem {
/**
* @param {DeleteSet} deletions
* @param {DeleteSet} insertions
*/
constructor(deletions: DeleteSet, insertions: DeleteSet);
insertions: DeleteSet;
deletions: DeleteSet;
/**
* Use this to save and restore metadata like selection range
*/
meta: Map<any, any>;
}
/**
* @typedef {Object} UndoManagerOptions
* @property {number} [UndoManagerOptions.captureTimeout=500]
* @property {function(Transaction):boolean} [UndoManagerOptions.captureTransaction] Do not capture changes of a Transaction if result false.
* @property {function(Item):boolean} [UndoManagerOptions.deleteFilter=()=>true] Sometimes
* it is necessary to filter what an Undo/Redo operation can delete. If this
* filter returns false, the type/item won't be deleted even it is in the
* undo/redo scope.
* @property {Set<any>} [UndoManagerOptions.trackedOrigins=new Set([null])]
* @property {boolean} [ignoreRemoteMapChanges] Experimental. By default, the UndoManager will never overwrite remote changes. Enable this property to enable overwriting remote changes on key-value changes (Y.Map, properties on Y.Xml, etc..).
* @property {Doc} [doc] The document that this UndoManager operates on. Only needed if typeScope is empty.
*/
/**
* @typedef {Object} StackItemEvent
* @property {StackItem} StackItemEvent.stackItem
* @property {any} StackItemEvent.origin
* @property {'undo'|'redo'} StackItemEvent.type
* @property {Map<AbstractType<YEvent<any>>,Array<YEvent<any>>>} StackItemEvent.changedParentTypes
*/
/**
* Fires 'stack-item-added' event when a stack item was added to either the undo- or
* the redo-stack. You may store additional stack information via the
* metadata property on `event.stackItem.meta` (it is a `Map` of metadata properties).
* Fires 'stack-item-popped' event when a stack item was popped from either the
* undo- or the redo-stack. You may restore the saved stack information from `event.stackItem.meta`.
*
* @extends {ObservableV2<{'stack-item-added':function(StackItemEvent, UndoManager):void, 'stack-item-popped': function(StackItemEvent, UndoManager):void, 'stack-cleared': function({ undoStackCleared: boolean, redoStackCleared: boolean }):void, 'stack-item-updated': function(StackItemEvent, UndoManager):void }>}
*/
export class UndoManager extends ObservableV2<{
'stack-item-added': (arg0: StackItemEvent, arg1: UndoManager) => void;
'stack-item-popped': (arg0: StackItemEvent, arg1: UndoManager) => void;
'stack-cleared': (arg0: {
undoStackCleared: boolean;
redoStackCleared: boolean;
}) => void;
'stack-item-updated': (arg0: StackItemEvent, arg1: UndoManager) => void;
}> {
/**
* @param {Doc|AbstractType<any>|Array<AbstractType<any>>} typeScope Limits the scope of the UndoManager. If this is set to a ydoc instance, all changes on that ydoc will be undone. If set to a specific type, only changes on that type or its children will be undone. Also accepts an array of types.
* @param {UndoManagerOptions} options
*/
constructor(typeScope: Doc | AbstractType<any> | Array<AbstractType<any>>, { captureTimeout, captureTransaction, deleteFilter, trackedOrigins, ignoreRemoteMapChanges, doc }?: UndoManagerOptions);
/**
* @type {Array<AbstractType<any> | Doc>}
*/
scope: Array<AbstractType<any> | Doc>;
doc: Doc;
deleteFilter: (arg0: Item) => boolean;
trackedOrigins: Set<any>;
captureTransaction: (arg0: Transaction) => boolean;
/**
* @type {Array<StackItem>}
*/
undoStack: Array<StackItem>;
/**
* @type {Array<StackItem>}
*/
redoStack: Array<StackItem>;
/**
* Whether the client is currently undoing (calling UndoManager.undo)
*
* @type {boolean}
*/
undoing: boolean;
redoing: boolean;
/**
* The currently popped stack item if UndoManager.undoing or UndoManager.redoing
*
* @type {StackItem|null}
*/
currStackItem: StackItem | null;
lastChange: number;
ignoreRemoteMapChanges: boolean;
captureTimeout: number;
/**
* @param {Transaction} transaction
*/
afterTransactionHandler: (transaction: Transaction) => void;
/**
* Extend the scope.
*
* @param {Array<AbstractType<any> | Doc> | AbstractType<any> | Doc} ytypes
*/
addToScope(ytypes: Array<AbstractType<any> | Doc> | AbstractType<any> | Doc): void;
/**
* @param {any} origin
*/
addTrackedOrigin(origin: any): void;
/**
* @param {any} origin
*/
removeTrackedOrigin(origin: any): void;
clear(clearUndoStack?: boolean, clearRedoStack?: boolean): void;
/**
* UndoManager merges Undo-StackItem if they are created within time-gap
* smaller than `options.captureTimeout`. Call `um.stopCapturing()` so that the next
* StackItem won't be merged.
*
*
* @example
* // without stopCapturing
* ytext.insert(0, 'a')
* ytext.insert(1, 'b')
* um.undo()
* ytext.toString() // => '' (note that 'ab' was removed)
* // with stopCapturing
* ytext.insert(0, 'a')
* um.stopCapturing()
* ytext.insert(0, 'b')
* um.undo()
* ytext.toString() // => 'a' (note that only 'b' was removed)
*
*/
stopCapturing(): void;
/**
* Undo last changes on type.
*
* @return {StackItem?} Returns StackItem if a change was applied
*/
undo(): StackItem | null;
/**
* Redo last undo operation.
*
* @return {StackItem?} Returns StackItem if a change was applied
*/
redo(): StackItem | null;
/**
* Are undo steps available?
*
* @return {boolean} `true` if undo is possible
*/
canUndo(): boolean;
/**
* Are redo steps available?
*
* @return {boolean} `true` if redo is possible
*/
canRedo(): boolean;
}
export type UndoManagerOptions = {
captureTimeout?: number | undefined;
/**
* Do not capture changes of a Transaction if result false.
*/
captureTransaction?: ((arg0: Transaction) => boolean) | undefined;
/**
* Sometimes
* it is necessary to filter what an Undo/Redo operation can delete. If this
* filter returns false, the type/item won't be deleted even it is in the
* undo/redo scope.
*/
deleteFilter?: ((arg0: Item) => boolean) | undefined;
trackedOrigins?: Set<any> | undefined;
/**
* Experimental. By default, the UndoManager will never overwrite remote changes. Enable this property to enable overwriting remote changes on key-value changes (Y.Map, properties on Y.Xml, etc..).
*/
ignoreRemoteMapChanges?: boolean | undefined;
/**
* The document that this UndoManager operates on. Only needed if typeScope is empty.
*/
doc?: Doc | undefined;
};
export type StackItemEvent = {
stackItem: StackItem;
origin: any;
type: 'undo' | 'redo';
changedParentTypes: Map<AbstractType<YEvent<any>>, Array<YEvent<any>>>;
};
import { DeleteSet } from "./DeleteSet.js";
import { ObservableV2 } from "lib0/observable";
import { AbstractType } from "../types/AbstractType.js";
import { Doc } from "./Doc.js";
import { Item } from "../structs/Item.js";
import { Transaction } from "./Transaction.js";
import { YEvent } from "./YEvent.js";
//# sourceMappingURL=UndoManager.d.ts.map

1
node_modules/yjs/dist/src/utils/UndoManager.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"UndoManager.d.ts","sourceRoot":"","sources":["../../../src/utils/UndoManager.js"],"names":[],"mappings":"AAoBA;IACE;;;OAGG;IACH,uBAHW,SAAS,cACT,SAAS,EASnB;IANC,sBAA4B;IAC5B,qBAA0B;IAC1B;;OAEG;IACH,oBAAqB;CAExB;AAgGD;;;;;;;;;;;GAWG;AAEH;;;;;;GAMG;AAEH;;;;;;;;GAQG;AACH;+BAFuD,cAAc,QAAE,WAAW,KAAE,IAAI;gCAAgC,cAAc,QAAE,WAAW,KAAE,IAAI;4BAA4B;QAAE,gBAAgB,EAAE,OAAO,CAAC;QAAC,gBAAgB,EAAE,OAAO,CAAA;KAAE,KAAE,IAAI;iCAAiC,cAAc,QAAE,WAAW,KAAE,IAAI;;IAGnT;;;OAGG;IACH,uBAHW,GAAG,GAAC,aAAa,GAAG,CAAC,GAAC,MAAM,aAAa,GAAG,CAAC,CAAC,sGAC9C,kBAAkB,EA6G5B;IAlGC;;OAEG;IACH,OAFU,MAAM,aAAa,GAAG,CAAC,GAAG,GAAG,CAAC,CAEzB;IACf,SAAc;IAEd,qBA9CmB,IAAI,KAAE,OAAO,CA8CA;IAEhC,yBAAoC;IACpC,2BAlDmB,WAAW,KAAE,OAAO,CAkDK;IAC5C;;OAEG;IACH,WAFU,MAAM,SAAS,CAAC,CAEP;IACnB;;OAEG;IACH,WAFU,MAAM,SAAS,CAAC,CAEP;IACnB;;;;OAIG;IACH,SAFU,OAAO,CAEG;IACpB,iBAAoB;IACpB;;;;OAIG;IACH,eAFU,SAAS,GAAC,IAAI,CAEC;IACzB,mBAAmB;IACnB,gCAAoD;IACpD,uBAAoC;IACpC;;OAEG;IACH,uCAFW,WAAW,UA0DrB;IAOH;;;;OAIG;IACH,mBAFW,MAAM,aAAa,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,aAAa,GAAG,CAAC,GAAG,GAAG,QAYlE;IAED;;OAEG;IACH,yBAFW,GAAG,QAIb;IAED;;OAEG;IACH,4BAFW,GAAG,QAIb;IAED,gEAcC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,sBAEC;IAED;;;;OAIG;IACH,QAFY,SAAS,QAWpB;IAED;;;;OAIG;IACH,QAFY,SAAS,QAWpB;IAED;;;;OAIG;IACH,WAFY,OAAO,CAIlB;IAED;;;;OAIG;IACH,WAFY,OAAO,CAIlB;CAOF;;;;;;iCA3QsB,WAAW,KAAE,OAAO;;;;;;;2BACpB,IAAI,KAAE,OAAO;;;;;;;;;;;;eAWtB,SAAS;YACT,GAAG;UACH,MAAM,GAAC,MAAM;wBACb,IAAI,aAAa,OAAO,GAAG,CAAC,CAAC,EAAC,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC"}

167
node_modules/yjs/dist/src/utils/UpdateDecoder.d.ts generated vendored Normal file
View File

@@ -0,0 +1,167 @@
export class DSDecoderV1 {
/**
* @param {decoding.Decoder} decoder
*/
constructor(decoder: decoding.Decoder);
restDecoder: decoding.Decoder;
resetDsCurVal(): void;
/**
* @return {number}
*/
readDsClock(): number;
/**
* @return {number}
*/
readDsLen(): number;
}
export class UpdateDecoderV1 extends DSDecoderV1 {
/**
* @return {ID}
*/
readLeftID(): ID;
/**
* @return {ID}
*/
readRightID(): ID;
/**
* Read the next client id.
* Use this in favor of readID whenever possible to reduce the number of objects created.
*/
readClient(): number;
/**
* @return {number} info An unsigned 8-bit integer
*/
readInfo(): number;
/**
* @return {string}
*/
readString(): string;
/**
* @return {boolean} isKey
*/
readParentInfo(): boolean;
/**
* @return {number} info An unsigned 8-bit integer
*/
readTypeRef(): number;
/**
* Write len of a struct - well suited for Opt RLE encoder.
*
* @return {number} len
*/
readLen(): number;
/**
* @return {any}
*/
readAny(): any;
/**
* @return {Uint8Array}
*/
readBuf(): Uint8Array;
/**
* Legacy implementation uses JSON parse. We use any-decoding in v2.
*
* @return {any}
*/
readJSON(): any;
/**
* @return {string}
*/
readKey(): string;
}
export class DSDecoderV2 {
/**
* @param {decoding.Decoder} decoder
*/
constructor(decoder: decoding.Decoder);
/**
* @private
*/
private dsCurrVal;
restDecoder: decoding.Decoder;
resetDsCurVal(): void;
/**
* @return {number}
*/
readDsClock(): number;
/**
* @return {number}
*/
readDsLen(): number;
}
export class UpdateDecoderV2 extends DSDecoderV2 {
/**
* List of cached keys. If the keys[id] does not exist, we read a new key
* from stringEncoder and push it to keys.
*
* @type {Array<string>}
*/
keys: Array<string>;
keyClockDecoder: decoding.IntDiffOptRleDecoder;
clientDecoder: decoding.UintOptRleDecoder;
leftClockDecoder: decoding.IntDiffOptRleDecoder;
rightClockDecoder: decoding.IntDiffOptRleDecoder;
infoDecoder: decoding.RleDecoder<number>;
stringDecoder: decoding.StringDecoder;
parentInfoDecoder: decoding.RleDecoder<number>;
typeRefDecoder: decoding.UintOptRleDecoder;
lenDecoder: decoding.UintOptRleDecoder;
/**
* @return {ID}
*/
readLeftID(): ID;
/**
* @return {ID}
*/
readRightID(): ID;
/**
* Read the next client id.
* Use this in favor of readID whenever possible to reduce the number of objects created.
*/
readClient(): number;
/**
* @return {number} info An unsigned 8-bit integer
*/
readInfo(): number;
/**
* @return {string}
*/
readString(): string;
/**
* @return {boolean}
*/
readParentInfo(): boolean;
/**
* @return {number} An unsigned 8-bit integer
*/
readTypeRef(): number;
/**
* Write len of a struct - well suited for Opt RLE encoder.
*
* @return {number}
*/
readLen(): number;
/**
* @return {any}
*/
readAny(): any;
/**
* @return {Uint8Array}
*/
readBuf(): Uint8Array;
/**
* This is mainly here for legacy purposes.
*
* Initial we incoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder.
*
* @return {any}
*/
readJSON(): any;
/**
* @return {string}
*/
readKey(): string;
}
import * as decoding from "lib0/decoding";
import { ID } from "./ID.js";
//# sourceMappingURL=UpdateDecoder.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"UpdateDecoder.d.ts","sourceRoot":"","sources":["../../../src/utils/UpdateDecoder.js"],"names":[],"mappings":"AAMA;IACE;;OAEG;IACH,qBAFW,SAAS,OAAO,EAI1B;IADC,8BAA0B;IAG5B,sBAEC;IAED;;OAEG;IACH,eAFY,MAAM,CAIjB;IAED;;OAEG;IACH,aAFY,MAAM,CAIjB;CACF;AAED;IACE;;OAEG;IACH,cAFY,EAAE,CAIb;IAED;;OAEG;IACH,eAFY,EAAE,CAIb;IAED;;;OAGG;IACH,qBAEC;IAED;;OAEG;IACH,YAFY,MAAM,CAIjB;IAED;;OAEG;IACH,cAFY,MAAM,CAIjB;IAED;;OAEG;IACH,kBAFY,OAAO,CAIlB;IAED;;OAEG;IACH,eAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,WAFY,MAAM,CAIjB;IAED;;OAEG;IACH,WAFY,GAAG,CAId;IAED;;OAEG;IACH,WAFY,UAAU,CAIrB;IAED;;;;OAIG;IACH,YAFY,GAAG,CAId;IAED;;OAEG;IACH,WAFY,MAAM,CAIjB;CACF;AAED;IACE;;OAEG;IACH,qBAFW,SAAS,OAAO,EAQ1B;IALC;;OAEG;IACH,kBAAkB;IAClB,8BAA0B;IAG5B,sBAEC;IAED;;OAEG;IACH,eAFY,MAAM,CAKjB;IAED;;OAEG;IACH,aAFY,MAAM,CAMjB;CACF;AAED;IAMI;;;;;OAKG;IACH,MAFU,MAAM,MAAM,CAAC,CAET;IAEd,+CAA6F;IAC7F,0CAAwF;IACxF,gDAA8F;IAC9F,iDAA+F;IAC/F,yCAAmG;IACnG,sCAAoF;IACpF,+CAAyG;IACzG,2CAAyF;IACzF,uCAAqF;IAGvF;;OAEG;IACH,cAFY,EAAE,CAIb;IAED;;OAEG;IACH,eAFY,EAAE,CAIb;IAED;;;OAGG;IACH,qBAEC;IAED;;OAEG;IACH,YAFY,MAAM,CAIjB;IAED;;OAEG;IACH,cAFY,MAAM,CAIjB;IAED;;OAEG;IACH,kBAFY,OAAO,CAIlB;IAED;;OAEG;IACH,eAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,WAFY,MAAM,CAIjB;IAED;;OAEG;IACH,WAFY,GAAG,CAId;IAED;;OAEG;IACH,WAFY,UAAU,CAIrB;IAED;;;;;;OAMG;IACH,YAFY,GAAG,CAId;IAED;;OAEG;IACH,WAFY,MAAM,CAWjB;CACF"}

164
node_modules/yjs/dist/src/utils/UpdateEncoder.d.ts generated vendored Normal file
View File

@@ -0,0 +1,164 @@
export class DSEncoderV1 {
restEncoder: encoding.Encoder;
toUint8Array(): Uint8Array;
resetDsCurVal(): void;
/**
* @param {number} clock
*/
writeDsClock(clock: number): void;
/**
* @param {number} len
*/
writeDsLen(len: number): void;
}
export class UpdateEncoderV1 extends DSEncoderV1 {
/**
* @param {ID} id
*/
writeLeftID(id: ID): void;
/**
* @param {ID} id
*/
writeRightID(id: ID): void;
/**
* Use writeClient and writeClock instead of writeID if possible.
* @param {number} client
*/
writeClient(client: number): void;
/**
* @param {number} info An unsigned 8-bit integer
*/
writeInfo(info: number): void;
/**
* @param {string} s
*/
writeString(s: string): void;
/**
* @param {boolean} isYKey
*/
writeParentInfo(isYKey: boolean): void;
/**
* @param {number} info An unsigned 8-bit integer
*/
writeTypeRef(info: number): void;
/**
* Write len of a struct - well suited for Opt RLE encoder.
*
* @param {number} len
*/
writeLen(len: number): void;
/**
* @param {any} any
*/
writeAny(any: any): void;
/**
* @param {Uint8Array} buf
*/
writeBuf(buf: Uint8Array): void;
/**
* @param {any} embed
*/
writeJSON(embed: any): void;
/**
* @param {string} key
*/
writeKey(key: string): void;
}
export class DSEncoderV2 {
restEncoder: encoding.Encoder;
dsCurrVal: number;
toUint8Array(): Uint8Array;
resetDsCurVal(): void;
/**
* @param {number} clock
*/
writeDsClock(clock: number): void;
/**
* @param {number} len
*/
writeDsLen(len: number): void;
}
export class UpdateEncoderV2 extends DSEncoderV2 {
/**
* @type {Map<string,number>}
*/
keyMap: Map<string, number>;
/**
* Refers to the next unique key-identifier to me used.
* See writeKey method for more information.
*
* @type {number}
*/
keyClock: number;
keyClockEncoder: encoding.IntDiffOptRleEncoder;
clientEncoder: encoding.UintOptRleEncoder;
leftClockEncoder: encoding.IntDiffOptRleEncoder;
rightClockEncoder: encoding.IntDiffOptRleEncoder;
infoEncoder: encoding.RleEncoder<number>;
stringEncoder: encoding.StringEncoder;
parentInfoEncoder: encoding.RleEncoder<number>;
typeRefEncoder: encoding.UintOptRleEncoder;
lenEncoder: encoding.UintOptRleEncoder;
/**
* @param {ID} id
*/
writeLeftID(id: ID): void;
/**
* @param {ID} id
*/
writeRightID(id: ID): void;
/**
* @param {number} client
*/
writeClient(client: number): void;
/**
* @param {number} info An unsigned 8-bit integer
*/
writeInfo(info: number): void;
/**
* @param {string} s
*/
writeString(s: string): void;
/**
* @param {boolean} isYKey
*/
writeParentInfo(isYKey: boolean): void;
/**
* @param {number} info An unsigned 8-bit integer
*/
writeTypeRef(info: number): void;
/**
* Write len of a struct - well suited for Opt RLE encoder.
*
* @param {number} len
*/
writeLen(len: number): void;
/**
* @param {any} any
*/
writeAny(any: any): void;
/**
* @param {Uint8Array} buf
*/
writeBuf(buf: Uint8Array): void;
/**
* This is mainly here for legacy purposes.
*
* Initial we incoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder.
*
* @param {any} embed
*/
writeJSON(embed: any): void;
/**
* Property keys are often reused. For example, in y-prosemirror the key `bold` might
* occur very often. For a 3d application, the key `position` might occur very often.
*
* We cache these keys in a Map and refer to them via a unique number.
*
* @param {string} key
*/
writeKey(key: string): void;
}
import * as encoding from "lib0/encoding";
import { ID } from "./ID.js";
//# sourceMappingURL=UpdateEncoder.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"UpdateEncoder.d.ts","sourceRoot":"","sources":["../../../src/utils/UpdateEncoder.js"],"names":[],"mappings":"AAOA;IAEI,8BAA2C;IAG7C,2BAEC;IAED,sBAEC;IAED;;OAEG;IACH,oBAFW,MAAM,QAIhB;IAED;;OAEG;IACH,gBAFW,MAAM,QAIhB;CACF;AAED;IACE;;OAEG;IACH,gBAFW,EAAE,QAKZ;IAED;;OAEG;IACH,iBAFW,EAAE,QAKZ;IAED;;;OAGG;IACH,oBAFW,MAAM,QAIhB;IAED;;OAEG;IACH,gBAFW,MAAM,QAIhB;IAED;;OAEG;IACH,eAFW,MAAM,QAIhB;IAED;;OAEG;IACH,wBAFW,OAAO,QAIjB;IAED;;OAEG;IACH,mBAFW,MAAM,QAIhB;IAED;;;;OAIG;IACH,cAFW,MAAM,QAIhB;IAED;;OAEG;IACH,cAFW,GAAG,QAIb;IAED;;OAEG;IACH,cAFW,UAAU,QAIpB;IAED;;OAEG;IACH,iBAFW,GAAG,QAIb;IAED;;OAEG;IACH,cAFW,MAAM,QAIhB;CACF;AAED;IAEI,8BAA2C;IAC3C,kBAAkB;IAGpB,2BAEC;IAED,sBAEC;IAED;;OAEG;IACH,oBAFW,MAAM,QAMhB;IAED;;OAEG;IACH,gBAFW,MAAM,QAQhB;CACF;AAED;IAGI;;OAEG;IACH,QAFU,IAAI,MAAM,EAAC,MAAM,CAAC,CAEL;IACvB;;;;;OAKG;IACH,UAFU,MAAM,CAEC;IACjB,+CAA0D;IAC1D,0CAAqD;IACrD,gDAA2D;IAC3D,iDAA4D;IAC5D,yCAA+D;IAC/D,sCAAiD;IACjD,+CAAqE;IACrE,2CAAsD;IACtD,uCAAkD;IAoBpD;;OAEG;IACH,gBAFW,EAAE,QAKZ;IAED;;OAEG;IACH,iBAFW,EAAE,QAKZ;IAED;;OAEG;IACH,oBAFW,MAAM,QAIhB;IAED;;OAEG;IACH,gBAFW,MAAM,QAIhB;IAED;;OAEG;IACH,eAFW,MAAM,QAIhB;IAED;;OAEG;IACH,wBAFW,OAAO,QAIjB;IAED;;OAEG;IACH,mBAFW,MAAM,QAIhB;IAED;;;;OAIG;IACH,cAFW,MAAM,QAIhB;IAED;;OAEG;IACH,cAFW,GAAG,QAIb;IAED;;OAEG;IACH,cAFW,UAAU,QAIpB;IAED;;;;;;OAMG;IACH,iBAFW,GAAG,QAIb;IAED;;;;;;;OAOG;IACH,cAFW,MAAM,QAwBhB;CACF"}

133
node_modules/yjs/dist/src/utils/YEvent.d.ts generated vendored Normal file
View File

@@ -0,0 +1,133 @@
/**
* @template {AbstractType<any>} T
* YEvent describes the changes on a YType.
*/
export class YEvent<T extends AbstractType<any>> {
/**
* @param {T} target The changed type.
* @param {Transaction} transaction
*/
constructor(target: T, transaction: Transaction);
/**
* The type on which this event was created on.
* @type {T}
*/
target: T;
/**
* The current target on which the observe callback is called.
* @type {AbstractType<any>}
*/
currentTarget: AbstractType<any>;
/**
* The transaction that triggered this event.
* @type {Transaction}
*/
transaction: Transaction;
/**
* @type {Object|null}
*/
_changes: Object | null;
/**
* @type {null | Map<string, { action: 'add' | 'update' | 'delete', oldValue: any }>}
*/
_keys: Map<string, {
action: 'add' | 'update' | 'delete';
oldValue: any;
}> | null;
/**
* @type {null | Array<{ insert?: string | Array<any> | object | AbstractType<any>, retain?: number, delete?: number, attributes?: Object<string, any> }>}
*/
_delta: {
insert?: string | object | any[] | AbstractType<any> | undefined;
retain?: number | undefined;
delete?: number | undefined;
attributes?: {
[x: string]: any;
} | undefined;
}[] | null;
/**
* @type {Array<string|number>|null}
*/
_path: Array<string | number> | null;
/**
* Computes the path from `y` to the changed type.
*
* @todo v14 should standardize on path: Array<{parent, index}> because that is easier to work with.
*
* The following property holds:
* @example
* let type = y
* event.path.forEach(dir => {
* type = type.get(dir)
* })
* type === event.target // => true
*/
get path(): (string | number)[];
/**
* Check if a struct is deleted by this event.
*
* In contrast to change.deleted, this method also returns true if the struct was added and then deleted.
*
* @param {AbstractStruct} struct
* @return {boolean}
*/
deletes(struct: AbstractStruct): boolean;
/**
* @type {Map<string, { action: 'add' | 'update' | 'delete', oldValue: any }>}
*/
get keys(): Map<string, {
action: 'add' | 'update' | 'delete';
oldValue: any;
}>;
/**
* This is a computed property. Note that this can only be safely computed during the
* event call. Computing this property after other changes happened might result in
* unexpected behavior (incorrect computation of deltas). A safe way to collect changes
* is to store the `changes` or the `delta` object. Avoid storing the `transaction` object.
*
* @type {Array<{insert?: string | Array<any> | object | AbstractType<any>, retain?: number, delete?: number, attributes?: Object<string, any>}>}
*/
get delta(): {
insert?: string | object | any[] | AbstractType<any> | undefined;
retain?: number | undefined;
delete?: number | undefined;
attributes?: {
[x: string]: any;
} | undefined;
}[];
/**
* Check if a struct is added by this event.
*
* In contrast to change.deleted, this method also returns true if the struct was added and then deleted.
*
* @param {AbstractStruct} struct
* @return {boolean}
*/
adds(struct: AbstractStruct): boolean;
/**
* This is a computed property. Note that this can only be safely computed during the
* event call. Computing this property after other changes happened might result in
* unexpected behavior (incorrect computation of deltas). A safe way to collect changes
* is to store the `changes` or the `delta` object. Avoid storing the `transaction` object.
*
* @type {{added:Set<Item>,deleted:Set<Item>,keys:Map<string,{action:'add'|'update'|'delete',oldValue:any}>,delta:Array<{insert?:Array<any>|string, delete?:number, retain?:number}>}}
*/
get changes(): {
added: Set<Item>;
deleted: Set<Item>;
keys: Map<string, {
action: 'add' | 'update' | 'delete';
oldValue: any;
}>;
delta: Array<{
insert?: Array<any> | string;
delete?: number;
retain?: number;
}>;
};
}
import { AbstractType } from "../types/AbstractType.js";
import { Transaction } from "./Transaction.js";
import { AbstractStruct } from "../structs/AbstractStruct.js";
import { Item } from "../structs/Item.js";
//# sourceMappingURL=YEvent.d.ts.map

1
node_modules/yjs/dist/src/utils/YEvent.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"YEvent.d.ts","sourceRoot":"","sources":["../../../src/utils/YEvent.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH;IACE;;;OAGG;IACH,oBAHW,CAAC,eACD,WAAW,EAkCrB;IA/BC;;;OAGG;IACH,QAFU,CAAC,CAES;IACpB;;;OAGG;IACH,eAFU,aAAa,GAAG,CAAC,CAEA;IAC3B;;;OAGG;IACH,aAFU,WAAW,CAES;IAC9B;;OAEG;IACH,UAFU,MAAM,GAAC,IAAI,CAED;IACpB;;OAEG;IACH;gBAFuC,KAAK,GAAG,QAAQ,GAAG,QAAQ;kBAAY,GAAG;cAEhE;IACjB;;OAEG;IACH;;;;;;;eAAkB;IAClB;;OAEG;IACH,OAFU,MAAM,MAAM,GAAC,MAAM,CAAC,GAAC,IAAI,CAElB;IAGnB;;;;;;;;;;;;OAYG;IACH,gCAEC;IAED;;;;;;;OAOG;IACH,gBAHW,cAAc,GACb,OAAO,CAIlB;IAED;;OAEG;IACH;gBAFgC,KAAK,GAAG,QAAQ,GAAG,QAAQ;kBAAY,GAAG;OAqDzE;IAED;;;;;;;OAOG;IACH;;;;;;;QAEC;IAED;;;;;;;OAOG;IACH,aAHW,cAAc,GACb,OAAO,CAIlB;IAED;;;;;;;OAOG;IACH;eAFiB,IAAI,IAAI,CAAC;iBAAS,IAAI,IAAI,CAAC;cAAM,IAAI,MAAM,EAAC;YAAC,MAAM,EAAC,KAAK,GAAC,QAAQ,GAAC,QAAQ,CAAC;YAAA,QAAQ,EAAC,GAAG,CAAA;SAAC,CAAC;eAAO,MAAM;YAAC,MAAM,CAAC,EAAC,MAAM,GAAG,CAAC,GAAC,MAAM,CAAC;YAAC,MAAM,CAAC,EAAC,MAAM,CAAC;YAAC,MAAM,CAAC,EAAC,MAAM,CAAA;SAAC,CAAC;MAkEnL;CACF"}

34
node_modules/yjs/dist/src/utils/encoding.d.ts generated vendored Normal file
View File

@@ -0,0 +1,34 @@
export function writeClientsStructs(encoder: UpdateEncoderV1 | UpdateEncoderV2, store: StructStore, _sm: Map<number, number>): void;
export function readClientsStructRefs(decoder: UpdateDecoderV1 | UpdateDecoderV2, doc: Doc): Map<number, {
i: number;
refs: Array<Item | GC>;
}>;
export function writeStructsFromTransaction(encoder: UpdateEncoderV1 | UpdateEncoderV2, transaction: Transaction): void;
export function readUpdateV2(decoder: decoding.Decoder, ydoc: Doc, transactionOrigin?: any, structDecoder?: UpdateDecoderV1 | UpdateDecoderV2 | undefined): void;
export function readUpdate(decoder: decoding.Decoder, ydoc: Doc, transactionOrigin?: any): void;
export function applyUpdateV2(ydoc: Doc, update: Uint8Array, transactionOrigin?: any, YDecoder?: typeof UpdateDecoderV1 | typeof UpdateDecoderV2 | undefined): void;
export function applyUpdate(ydoc: Doc, update: Uint8Array, transactionOrigin?: any): void;
export function writeStateAsUpdate(encoder: UpdateEncoderV1 | UpdateEncoderV2, doc: Doc, targetStateVector?: Map<number, number> | undefined): void;
export function encodeStateAsUpdateV2(doc: Doc, encodedTargetStateVector?: Uint8Array | undefined, encoder?: UpdateEncoderV2 | UpdateEncoderV1 | undefined): Uint8Array;
export function encodeStateAsUpdate(doc: Doc, encodedTargetStateVector?: Uint8Array | undefined): Uint8Array;
export function readStateVector(decoder: DSDecoderV1 | DSDecoderV2): Map<number, number>;
export function decodeStateVector(decodedState: Uint8Array): Map<number, number>;
export function writeStateVector(encoder: DSEncoderV1 | DSEncoderV2, sv: Map<number, number>): DSEncoderV1 | DSEncoderV2;
export function writeDocumentStateVector(encoder: DSEncoderV1 | DSEncoderV2, doc: Doc): DSEncoderV1 | DSEncoderV2;
export function encodeStateVectorV2(doc: Doc | Map<number, number>, encoder?: DSEncoderV1 | DSEncoderV2 | undefined): Uint8Array;
export function encodeStateVector(doc: Doc | Map<number, number>): Uint8Array;
import { UpdateEncoderV1 } from "./UpdateEncoder.js";
import { UpdateEncoderV2 } from "./UpdateEncoder.js";
import { StructStore } from "./StructStore.js";
import { UpdateDecoderV1 } from "./UpdateDecoder.js";
import { UpdateDecoderV2 } from "./UpdateDecoder.js";
import { Doc } from "./Doc.js";
import { Item } from "../structs/Item.js";
import { GC } from "../structs/GC.js";
import { Transaction } from "./Transaction.js";
import * as decoding from "lib0/decoding";
import { DSDecoderV1 } from "./UpdateDecoder.js";
import { DSDecoderV2 } from "./UpdateDecoder.js";
import { DSEncoderV1 } from "./UpdateEncoder.js";
import { DSEncoderV2 } from "./UpdateEncoder.js";
//# sourceMappingURL=encoding.d.ts.map

1
node_modules/yjs/dist/src/utils/encoding.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../../src/utils/encoding.js"],"names":[],"mappings":"AAgFO,6CAPI,eAAe,GAAG,eAAe,SACjC,WAAW,OACX,IAAI,MAAM,EAAC,MAAM,CAAC,QA0B5B;AAUM,+CAPI,eAAe,GAAG,eAAe,OACjC,GAAG,GACF,IAAI,MAAM,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,GAAG,EAAE,CAAC,CAAA;CAAE,CAAC,CA2F7D;AA0KM,qDANI,eAAe,GAAG,eAAe,eACjC,WAAW,QAK2H;AAc1I,sCAPI,SAAS,OAAO,QAChB,GAAG,sBACH,GAAG,uEAwEgB;AAavB,oCANI,SAAS,OAAO,QAChB,GAAG,sBACH,GAAG,QAI8H;AAcrI,oCAPI,GAAG,UACH,UAAU,sBACV,GAAG,gFAQb;AAaM,kCANI,GAAG,UACH,UAAU,sBACV,GAAG,QAIiH;AAYxH,4CANI,eAAe,GAAG,eAAe,OACjC,GAAG,6DAQb;AAeM,2CAPI,GAAG,+GAGF,UAAU,CAuBrB;AAcM,yCANI,GAAG,sDAEF,UAAU,CAI2H;AAU1I,yCALI,WAAW,GAAG,WAAW,GACxB,IAAI,MAAM,EAAC,MAAM,CAAC,CAa7B;AAoBM,gDALI,UAAU,GACT,IAAI,MAAM,EAAC,MAAM,CAAC,CAIyF;AAOhH,0CAJI,WAAW,GAAG,WAAW,MACzB,IAAI,MAAM,EAAC,MAAM,CAAC,6BAU5B;AAQM,kDALI,WAAW,GAAG,WAAW,OACzB,GAAG,6BAIgG;AAWvG,yCANI,GAAG,GAAC,IAAI,MAAM,EAAC,MAAM,CAAC,oDAErB,UAAU,CAWrB;AAUM,uCALI,GAAG,GAAC,IAAI,MAAM,EAAC,MAAM,CAAC,GACrB,UAAU,CAI6D"}

4
node_modules/yjs/dist/src/utils/isParentOf.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export function isParentOf(parent: AbstractType<any>, child: Item | null): boolean;
import { AbstractType } from "../types/AbstractType.js";
import { Item } from "../structs/Item.js";
//# sourceMappingURL=isParentOf.d.ts.map

1
node_modules/yjs/dist/src/utils/isParentOf.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"isParentOf.d.ts","sourceRoot":"","sources":["../../../src/utils/isParentOf.js"],"names":[],"mappings":"AAYO,mCAPI,aAAa,GAAG,CAAC,SACjB,IAAI,GAAC,IAAI,WAcnB"}

3
node_modules/yjs/dist/src/utils/logging.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export function logType(type: AbstractType<any>): void;
import { AbstractType } from "../types/AbstractType.js";
//# sourceMappingURL=logging.d.ts.map

1
node_modules/yjs/dist/src/utils/logging.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../src/utils/logging.js"],"names":[],"mappings":"AAWO,8BAFI,aAAa,GAAG,CAAC,QAW3B"}

89
node_modules/yjs/dist/src/utils/updates.d.ts generated vendored Normal file
View File

@@ -0,0 +1,89 @@
export class LazyStructReader {
/**
* @param {UpdateDecoderV1 | UpdateDecoderV2} decoder
* @param {boolean} filterSkips
*/
constructor(decoder: UpdateDecoderV1 | UpdateDecoderV2, filterSkips: boolean);
gen: Generator<GC | Item | Skip, void, unknown>;
/**
* @type {null | Item | Skip | GC}
*/
curr: null | Item | Skip | GC;
done: boolean;
filterSkips: boolean;
/**
* @return {Item | GC | Skip |null}
*/
next(): Item | GC | Skip | null;
}
export function logUpdate(update: Uint8Array): void;
export function logUpdateV2(update: Uint8Array, YDecoder?: typeof UpdateDecoderV1 | typeof UpdateDecoderV2 | undefined): void;
export function decodeUpdate(update: Uint8Array): {
structs: (GC | Item | Skip)[];
ds: import("./DeleteSet.js").DeleteSet;
};
export function decodeUpdateV2(update: Uint8Array, YDecoder?: typeof UpdateDecoderV1 | typeof UpdateDecoderV2 | undefined): {
structs: (GC | Item | Skip)[];
ds: import("./DeleteSet.js").DeleteSet;
};
export class LazyStructWriter {
/**
* @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
*/
constructor(encoder: UpdateEncoderV1 | UpdateEncoderV2);
currClient: number;
startClock: number;
written: number;
encoder: UpdateEncoderV2 | UpdateEncoderV1;
/**
* We want to write operations lazily, but also we need to know beforehand how many operations we want to write for each client.
*
* This kind of meta-information (#clients, #structs-per-client-written) is written to the restEncoder.
*
* We fragment the restEncoder and store a slice of it per-client until we know how many clients there are.
* When we flush (toUint8Array) we write the restEncoder using the fragments and the meta-information.
*
* @type {Array<{ written: number, restEncoder: Uint8Array }>}
*/
clientStructs: {
written: number;
restEncoder: Uint8Array;
}[];
}
export function mergeUpdates(updates: Array<Uint8Array>): Uint8Array;
export function encodeStateVectorFromUpdateV2(update: Uint8Array, YEncoder?: typeof DSEncoderV1 | typeof DSEncoderV2, YDecoder?: typeof UpdateDecoderV1 | typeof UpdateDecoderV2): Uint8Array;
export function encodeStateVectorFromUpdate(update: Uint8Array): Uint8Array;
export function parseUpdateMetaV2(update: Uint8Array, YDecoder?: typeof UpdateDecoderV1 | typeof UpdateDecoderV2): {
from: Map<number, number>;
to: Map<number, number>;
};
export function parseUpdateMeta(update: Uint8Array): {
from: Map<number, number>;
to: Map<number, number>;
};
export function mergeUpdatesV2(updates: Array<Uint8Array>, YDecoder?: typeof UpdateDecoderV1 | typeof UpdateDecoderV2 | undefined, YEncoder?: typeof UpdateEncoderV2 | typeof UpdateEncoderV1 | undefined): Uint8Array;
export function diffUpdateV2(update: Uint8Array, sv: Uint8Array, YDecoder?: typeof UpdateDecoderV1 | typeof UpdateDecoderV2 | undefined, YEncoder?: typeof UpdateEncoderV2 | typeof UpdateEncoderV1 | undefined): Uint8Array;
export function diffUpdate(update: Uint8Array, sv: Uint8Array): Uint8Array;
export function convertUpdateFormat(update: Uint8Array, blockTransformer: (arg0: Item | GC | Skip) => Item | GC | Skip, YDecoder: typeof UpdateDecoderV2 | typeof UpdateDecoderV1, YEncoder: typeof UpdateEncoderV2 | typeof UpdateEncoderV1): Uint8Array;
export function obfuscateUpdate(update: Uint8Array, opts?: ObfuscatorOptions | undefined): Uint8Array;
export function obfuscateUpdateV2(update: Uint8Array, opts?: ObfuscatorOptions | undefined): Uint8Array;
export function convertUpdateFormatV1ToV2(update: Uint8Array): Uint8Array;
export function convertUpdateFormatV2ToV1(update: Uint8Array): Uint8Array;
export type ObfuscatorOptions = {
formatting?: boolean | undefined;
subdocs?: boolean | undefined;
/**
* Whether to obfuscate nodeName / hookName
*/
yxml?: boolean | undefined;
};
import { GC } from "../structs/GC.js";
import { Item } from "../structs/Item.js";
import { Skip } from "../structs/Skip.js";
import { UpdateDecoderV1 } from "./UpdateDecoder.js";
import { UpdateDecoderV2 } from "./UpdateDecoder.js";
import { UpdateEncoderV2 } from "./UpdateEncoder.js";
import { UpdateEncoderV1 } from "./UpdateEncoder.js";
import { DSEncoderV1 } from "./UpdateEncoder.js";
import { DSEncoderV2 } from "./UpdateEncoder.js";
//# sourceMappingURL=updates.d.ts.map

1
node_modules/yjs/dist/src/utils/updates.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"updates.d.ts","sourceRoot":"","sources":["../../../src/utils/updates.js"],"names":[],"mappings":"AAmFA;IACE;;;OAGG;IACH,qBAHW,eAAe,GAAG,eAAe,eACjC,OAAO,EAWjB;IARC,gDAA6C;IAC7C;;OAEG;IACH,MAFU,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,EAAE,CAEjB;IAChB,cAAiB;IACjB,qBAA8B;IAIhC;;OAEG;IACH,QAFY,IAAI,GAAG,EAAE,GAAG,IAAI,GAAE,IAAI,CAQjC;CACF;AAMM,kCAHI,UAAU,QAGkD;AAOhE,oCAJI,UAAU,gFAcpB;AAMM,qCAHI,UAAU;;;EAG0D;AAOxE,uCAJI,UAAU;;;EAepB;AAED;IACE;;OAEG;IACH,qBAFW,eAAe,GAAG,eAAe,EAkB3C;IAfC,mBAAmB;IACnB,mBAAmB;IACnB,gBAAgB;IAChB,2CAAsB;IACtB;;;;;;;;;OASG;IACH;iBAF2B,MAAM;qBAAe,UAAU;QAEnC;CAE1B;AAMM,sCAHI,MAAM,UAAU,CAAC,GAChB,UAAU,CAE0E;AAQzF,sDALI,UAAU,aACV,kBAAkB,GAAG,kBAAkB,aACvC,sBAAsB,GAAG,sBAAsB,GAC9C,UAAU,CAgDrB;AAMM,oDAHI,UAAU,GACT,UAAU,CAEkG;AAOjH,0CAJI,UAAU,aACV,sBAAsB,GAAG,sBAAsB;UACtC,IAAI,MAAM,EAAC,MAAM,CAAC;QAAM,IAAI,MAAM,EAAC,MAAM,CAAC;EAkC7D;AAMM,wCAHI,UAAU,GACT;IAAE,IAAI,EAAE,IAAI,MAAM,EAAC,MAAM,CAAC,CAAC;IAAC,EAAE,EAAE,IAAI,MAAM,EAAC,MAAM,CAAC,CAAA;CAAE,CAEmB;AA0C5E,wCALI,MAAM,UAAU,CAAC,mJAGhB,UAAU,CAgIrB;AAQM,qCALI,UAAU,MACV,UAAU,8JAsCpB;AAMM,mCAHI,UAAU,MACV,UAAU,cAE+E;AAwE7F,4CALI,UAAU,2BACD,IAAI,GAAC,EAAE,GAAC,IAAI,KAAE,IAAI,GAAC,EAAE,GAAC,IAAI,YACnC,sBAAsB,GAAG,sBAAsB,YAC/C,sBAAsB,GAAG,sBAAsB,cAczD;AAmHM,wCAHI,UAAU,oDAGiH;AAM/H,0CAHI,UAAU,oDAGmH;AAKjI,kDAFI,UAAU,cAEiG;AAK/G,kDAFI,UAAU,cAEiG"}