Skip to content

Commit 13e98f1

Browse files
committed
Add YDocument.providers attribute
1 parent 803631d commit 13e98f1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

javascript/src/ydocument.ts

+12
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@
44
|----------------------------------------------------------------------------*/
55

66
import { JSONExt, JSONObject, JSONValue } from '@lumino/coreutils';
7+
import { IDisposable } from '@lumino/disposable';
78
import { ISignal, Signal } from '@lumino/signaling';
89
import { Awareness } from 'y-protocols/awareness';
910
import * as Y from 'yjs';
1011
import type { DocumentChange, ISharedDocument, StateChange } from './api.js';
1112

13+
/**
14+
* An interface for a document provider.
15+
*/
16+
export interface IDocumentProvider extends IDisposable {
17+
/**
18+
* Returns a Promise that resolves when the document provider is ready.
19+
*/
20+
readonly ready: Promise<void>;
21+
}
22+
1223
/**
1324
* Generic shareable document.
1425
*/
@@ -200,6 +211,7 @@ export abstract class YDocument<T extends DocumentChange>
200211
private _awareness: Awareness;
201212
private _isDisposed = false;
202213
private _disposed = new Signal<this, void>(this);
214+
providers: IDocumentProvider[] = [];
203215
}
204216

205217
/**

0 commit comments

Comments
 (0)