diff --git a/javascript/src/ydocument.ts b/javascript/src/ydocument.ts index c923c12..576d184 100644 --- a/javascript/src/ydocument.ts +++ b/javascript/src/ydocument.ts @@ -4,11 +4,22 @@ |----------------------------------------------------------------------------*/ import { JSONExt, JSONObject, JSONValue } from '@lumino/coreutils'; +import { IDisposable } from '@lumino/disposable'; import { ISignal, Signal } from '@lumino/signaling'; import { Awareness } from 'y-protocols/awareness'; import * as Y from 'yjs'; import type { DocumentChange, ISharedDocument, StateChange } from './api.js'; +/** + * An interface for a document provider. + */ +export interface IDocumentProvider extends IDisposable { + /** + * Returns a Promise that resolves when the document provider is ready. + */ + readonly ready: Promise; +} + /** * Generic shareable document. */ @@ -200,6 +211,7 @@ export abstract class YDocument private _awareness: Awareness; private _isDisposed = false; private _disposed = new Signal(this); + providers: IDocumentProvider[] = []; } /**