From 4cf8231bac9daf8f453bb689e69ceaeaa43d5c83 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Thu, 17 Oct 2024 13:42:53 +0200 Subject: [PATCH] Remove any --- packages/voila/package.json | 1 + packages/voila/src/app.ts | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/voila/package.json b/packages/voila/package.json index 10b4b0d6e..ea31cfa82 100644 --- a/packages/voila/package.json +++ b/packages/voila/package.json @@ -11,6 +11,7 @@ }, "browserslist": ">0.8%, not ie 11, not op_mini all, not dead", "dependencies": { + "@voila-dashboards/widgets-manager8": "^0.5.7", "@jupyterlab/application": "^4.0.0", "@jupyterlab/apputils": "^4.0.0", "@jupyterlab/apputils-extension": "^4.0.0", diff --git a/packages/voila/src/app.ts b/packages/voila/src/app.ts index 325427e66..dfe79f85f 100644 --- a/packages/voila/src/app.ts +++ b/packages/voila/src/app.ts @@ -12,6 +12,11 @@ import { IRenderMime } from '@jupyterlab/rendermime'; import { IShell, VoilaShell } from './shell'; +// Only import the type, it is important to not import the library at runtime +// to not pollute the shared packages with widgets related things +import { type VoilaWidgetManager } from '@voila-dashboards/widgets-manager8/lib/manager'; + + const PACKAGE = require('../package.json'); /** @@ -119,23 +124,23 @@ export class VoilaApp extends JupyterFrontEnd { /** * A promise that resolves when the Voila Widget Manager is created */ - get widgetManagerPromise(): PromiseDelegate { + get widgetManagerPromise(): PromiseDelegate { return this._widgetManagerPromise; } - set widgetManager(manager: any) { + set widgetManager(manager: VoilaWidgetManager | null) { this._widgetManager = manager; if (this._widgetManager) { this._widgetManagerPromise.resolve(this._widgetManager); } } - get widgetManager(): any { + get widgetManager(): VoilaWidgetManager | null { return this._widgetManager; } - protected _widgetManager: any = null; - protected _widgetManagerPromise = new PromiseDelegate(); + protected _widgetManager: VoilaWidgetManager | null = null; + protected _widgetManagerPromise = new PromiseDelegate(); } /**