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 {
157
157
* @param forkId The fork ID to add to the document
158
158
*/
159
159
addFork ( forkId : string ) : void ;
160
+
161
+ /**
162
+ * The document fork ID
163
+ */
164
+ forkId : string ;
160
165
}
161
166
162
167
/**
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export abstract class YDocument<T extends DocumentChange>
17
17
{
18
18
constructor ( options ?: YDocument . IOptions ) {
19
19
this . _ydoc = options ?. ydoc ?? new Y . Doc ( ) ;
20
+ this . forkId = options ?. forkId ?? 'root' ;
20
21
21
22
this . _ystate = this . _ydoc . getMap ( 'state' ) ;
22
23
@@ -257,6 +258,7 @@ export abstract class YDocument<T extends DocumentChange>
257
258
private _isDisposed = false ;
258
259
private _disposed = new Signal < this, void > ( this ) ;
259
260
private _providers : { [ key : string ] : IDocumentProvider } ;
261
+ public forkId : string ;
260
262
}
261
263
262
264
/**
@@ -271,5 +273,10 @@ export namespace YDocument {
271
273
* The optional YJS document for YDocument.
272
274
*/
273
275
ydoc ?: Y . Doc ;
276
+
277
+ /**
278
+ * The document fork ID, defaults to 'root'.
279
+ */
280
+ forkId ?: string ;
274
281
}
275
282
}
You can’t perform that action at this time.
0 commit comments