|
@@ -22,10 +22,35 @@ type JupyterLabPlugin<T> = Application.IPlugin<JupyterLab, T>;
|
|
|
*/
|
|
|
export
|
|
|
class JupyterLab extends Application<ApplicationShell> {
|
|
|
+ /**
|
|
|
+ * Create a new JupyterLab instance.
|
|
|
+ */
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
+ this._startedPromise = new Promise(fn => { this._startedResolve = fn; });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * A promise that resolves when the JupyterLab application is started.
|
|
|
+ */
|
|
|
+ get started(): Promise<void> {
|
|
|
+ return this._startedPromise;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Start the JupyterLab application.
|
|
|
+ */
|
|
|
+ start(options: Application.IStartOptions = {}): Promise<void> {
|
|
|
+ return super.start(options).then(() => { this._startedResolve(); });
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Create the application shell for the JupyterLab application.
|
|
|
*/
|
|
|
protected createShell(): ApplicationShell {
|
|
|
return new ApplicationShell();
|
|
|
}
|
|
|
+
|
|
|
+ private _startedResolve: () => void;
|
|
|
+ private _startedPromise: Promise<void> = null;
|
|
|
}
|