File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,11 @@ interface ISharedDocumentNoSource extends ISharedBase {
157157 * @param forkId The fork ID to add to the document
158158 */
159159 addFork ( forkId : string ) : void ;
160+
161+ /**
162+ * The document fork ID
163+ */
164+ forkId : string ;
160165}
161166
162167/**
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export abstract class YDocument<T extends DocumentChange>
1717{
1818 constructor ( options ?: YDocument . IOptions ) {
1919 this . _ydoc = options ?. ydoc ?? new Y . Doc ( ) ;
20+ this . forkId = options ?. forkId ?? 'root' ;
2021
2122 this . _ystate = this . _ydoc . getMap ( 'state' ) ;
2223
@@ -257,6 +258,7 @@ export abstract class YDocument<T extends DocumentChange>
257258 private _isDisposed = false ;
258259 private _disposed = new Signal < this, void > ( this ) ;
259260 private _providers : { [ key : string ] : IDocumentProvider } ;
261+ public forkId : string ;
260262}
261263
262264/**
@@ -271,5 +273,10 @@ export namespace YDocument {
271273 * The optional YJS document for YDocument.
272274 */
273275 ydoc ?: Y . Doc ;
276+
277+ /**
278+ * The document fork ID, defaults to 'root'.
279+ */
280+ forkId ?: string ;
274281 }
275282}
You can’t perform that action at this time.
0 commit comments