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 @@ -156,6 +156,11 @@ export interface ISharedDocument extends ISharedBase {
156156 * @param forkId The fork ID to add to the document
157157 */
158158 addFork ( forkId : string ) : void ;
159+
160+ /**
161+ * The document fork ID
162+ */
163+ forkId : string ;
159164}
160165
161166/**
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
@@ -225,6 +226,7 @@ export abstract class YDocument<T extends DocumentChange>
225226 private _isDisposed = false ;
226227 private _disposed = new Signal < this, void > ( this ) ;
227228 private _providers : { [ key : string ] : IDocumentProvider } ;
229+ public forkId : string ;
228230}
229231
230232/**
@@ -239,5 +241,10 @@ export namespace YDocument {
239241 * The optional YJS document for YDocument.
240242 */
241243 ydoc ?: Y . Doc ;
244+
245+ /**
246+ * The document fork ID, defaults to 'root'.
247+ */
248+ forkId ?: string ;
242249 }
243250}
You can’t perform that action at this time.
0 commit comments