Add more type definitions (#882)

* More typing to base.ts

* Add more types

* More types
This commit is contained in:
Fábio Rosado
2022-10-27 23:48:28 +01:00
committed by GitHub
parent 4850f39b5a
commit 1c53d91c6b
13 changed files with 115 additions and 29 deletions

View File

@@ -1,4 +1,5 @@
import type { Runtime } from '../runtime';
import type {PyProxy} from "pyodide"
import { getLogger } from '../logger';
const logger = getLogger('py-register-widget');
@@ -12,7 +13,7 @@ function createWidget(runtime: Runtime, name: string, code: string, klass: strin
name: string = name;
klass: string = klass;
code: string = code;
proxy: any;
proxy: PyProxy;
proxyClass: any;
constructor() {
@@ -38,7 +39,9 @@ function createWidget(runtime: Runtime, name: string, code: string, klass: strin
runtime.globals.set(this.id, this.proxy);
}
}
/* eslint-disable @typescript-eslint/no-unused-vars */
const xPyWidget = customElements.define(name, CustomWidget);
/* eslint-enable @typescript-eslint/no-unused-vars */
}
export function make_PyWidget(runtime: Runtime) {