diff --git a/packages/voila/src/kernel.ts b/packages/voila/src/kernel.ts index 2c27bce40..7ec07a3aa 100644 --- a/packages/voila/src/kernel.ts +++ b/packages/voila/src/kernel.ts @@ -19,6 +19,6 @@ export async function connectKernel( const connectionInfo = ServerConnection.makeSettings({ baseUrl }); const model = await Kernel.findById(kernelId, connectionInfo); - const kernel = await Kernel.connectTo(model, connectionInfo); + const kernel = Kernel.connectTo(model, connectionInfo); return kernel; } diff --git a/packages/voila/src/loader.ts b/packages/voila/src/loader.ts index 3353d5160..33022a7c5 100644 --- a/packages/voila/src/loader.ts +++ b/packages/voila/src/loader.ts @@ -14,7 +14,7 @@ const cdn = 'https://unpkg.com/'; * * @param pkg Package name or names to load */ -const requirePromise = function(pkg) { +const requirePromise = function(pkg: string[]) { return new Promise((resolve, reject) => { const require = window.requirejs; if (require === undefined) { @@ -25,7 +25,7 @@ const requirePromise = function(pkg) { }); }; -function moduleNameToCDNUrl(moduleName, moduleVersion) { +function moduleNameToCDNUrl(moduleName: string, moduleVersion: string) { let packageName = moduleName; let fileName = 'index'; // default filename // if a '/' is present, like 'foo/bar', packageName is changed to 'foo', and path to 'bar' @@ -70,7 +70,7 @@ export function requireLoader( 'Requirejs is needed, please ensure it is loaded on the page.' ); } - const conf = { paths: {} }; + const conf: { paths: { [key: string]: string } } = { paths: {} }; conf.paths[moduleName] = moduleNameToCDNUrl(moduleName, moduleVersion); require.undef(failedId); require.config(conf); diff --git a/packages/voila/src/manager.ts b/packages/voila/src/manager.ts index 127b7d047..72898fc63 100644 --- a/packages/voila/src/manager.ts +++ b/packages/voila/src/manager.ts @@ -115,7 +115,7 @@ export class WidgetManager extends JupyterLabManager { } if (view.el) { view.el.setAttribute('data-voila-jupyter-widget', ''); - view.el.addEventListener('jupyterWidgetResize', e => { + view.el.addEventListener('jupyterWidgetResize', (e: Event) => { MessageLoop.postMessage( view.pWidget, PhosphorWidget.Widget.ResizeMessage.UnknownSize @@ -179,7 +179,7 @@ export class WidgetManager extends JupyterLabManager { async _build_models(): Promise<{ [key: string]: base.WidgetModel }> { const comm_ids = await this._get_comm_info(); - const models = {}; + const models: { [key: string]: base.WidgetModel } = {}; /** * For the classical notebook, iopub_msg_rate_limit=1000 (default) * And for zmq, we are affected by the default ZMQ_SNDHWM setting of 1000 diff --git a/packages/voila/src/utils.ts b/packages/voila/src/utils.ts index bb01d19cf..882ce7142 100644 --- a/packages/voila/src/utils.ts +++ b/packages/voila/src/utils.ts @@ -1,6 +1,7 @@ import pLimit from 'p-limit'; -const delay = sec => new Promise(resolve => setTimeout(resolve, sec * 1000)); +const delay = (sec: number) => + new Promise(resolve => setTimeout(resolve, sec * 1000)); /** * Map a function onto a list where fn is being called at a limit of 'rate' number of calls per second. diff --git a/packages/voila/tsconfig.json b/packages/voila/tsconfig.json index d27376230..399b75b7a 100644 --- a/packages/voila/tsconfig.json +++ b/packages/voila/tsconfig.json @@ -2,7 +2,6 @@ "extends": "../../tsconfigbase", "compilerOptions": { "outDir": "lib", - "noImplicitAny": false, "rootDir": "src" }, "include": ["src/**/*"]