Use the type definition of pyodide (#535)

* Import the type definition

* Add type annotations
This commit is contained in:
woxtu
2022-06-25 04:25:14 +09:00
committed by GitHub
parent 479348eec9
commit c7942d7d8f
6 changed files with 4115 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
import { loadedEnvironments, mode, pyodideLoaded } from '../stores';
import { guidGenerator, addClasses, removeClasses } from '../utils';
import type { PyodideInterface } from '../pyodide';
// Premise used to connect to the first available pyodide interpreter
let runtime;
let environments;
@@ -17,11 +18,6 @@ mode.subscribe(value => {
currentMode = value;
});
// TODO: use type declaractions
type PyodideInterface = {
registerJsModule(name: string, module: object): void;
};
export class BaseEvalElement extends HTMLElement {
shadow: ShadowRoot;
wrapper: HTMLElement;