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 @@ export interface ISharedDocument 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
@@ -225,6 +226,7 @@ export abstract class YDocument<T extends DocumentChange>
225
226
private _isDisposed = false ;
226
227
private _disposed = new Signal < this, void > ( this ) ;
227
228
private _providers : { [ key : string ] : IDocumentProvider } ;
229
+ public forkId : string ;
228
230
}
229
231
230
232
/**
@@ -239,5 +241,10 @@ export namespace YDocument {
239
241
* The optional YJS document for YDocument.
240
242
*/
241
243
ydoc ?: Y . Doc ;
244
+
245
+ /**
246
+ * The document fork ID, defaults to 'root'.
247
+ */
248
+ forkId ?: string ;
242
249
}
243
250
}
You can’t perform that action at this time.
0 commit comments