Refactoring loadPyodide typing (#8775)

* Refactoring loadPyodide typing

* add changeset

* Fix

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Yuichiro Tachibana (Tsuchiya) 2024-07-18 04:18:47 +09:00 committed by GitHub
parent 2de9a97ae9
commit e36bab77e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 3 deletions

View File

@ -0,0 +1,6 @@
---
"@gradio/wasm": minor
"gradio": minor
---
feat:Refactoring loadPyodide typing

View File

@ -1,2 +0,0 @@
// Declarations for the WebWorker files where some variables are dynamically loaded through importScript.
declare let loadPyodide: any;

View File

@ -1,7 +1,10 @@
/// <reference lib="webworker" />
/* eslint-env worker */
import type { PyodideInterface } from "pyodide";
import type {
PyodideInterface,
loadPyodide as loadPyodideValue
} from "pyodide";
import type { PyProxy } from "pyodide/ffi";
import type {
InMessage,
@ -30,6 +33,8 @@ type MessageTransceiver = DedicatedWorkerGlobalScope | MessagePort;
let pyodide: PyodideInterface;
let micropip: PyProxy;
declare let loadPyodide: typeof loadPyodideValue; // This will be dynamically loaded by importScript.
let call_asgi_app_from_js: (
appId: string,
scope: unknown,