mirror of
https://github.com/pyscript/pyscript.git
synced 2026-02-18 04:01:10 -05:00
Add more type definitions (#882)
* More typing to base.ts * Add more types * More types
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { basicSetup, EditorView } from 'codemirror';
|
||||
import { python } from '@codemirror/lang-python';
|
||||
import { indentUnit } from '@codemirror/language'
|
||||
import { Compartment, StateCommand } from '@codemirror/state';
|
||||
import { Compartment } from '@codemirror/state';
|
||||
import { keymap } from '@codemirror/view';
|
||||
import { defaultKeymap } from '@codemirror/commands';
|
||||
import { oneDarkTheme } from '@codemirror/theme-one-dark';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { addClasses, htmlDecode, ensureUniqueId } from '../utils';
|
||||
import { addClasses, htmlDecode } from '../utils';
|
||||
|
||||
export class PyTitle extends HTMLElement {
|
||||
widths: string[];
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user