Type up your exposed Python Eel functions in TypeScript so that you can call them from the eel global with some level of type safety.
Grab eel.d.ts and place it in your project.
Manually type up (or find a converter for) your Python functions in TypeScript and declare eel's type:
// Type up the exposed Python functions in TypeScript:interfaceMyPyFuncs{// def get_number() -> float:get_number(): number;// def save_number(num: float) -> None:save_number(num: number): void;}// Declare the eel global:declareconsteel: Eel<MyPyFuncs>;// Or potentially on window:interfaceWindow{eel: Eel<MyPyFuncs>;}// Or make a typed alias:conste=eelasEel<MyPyFuncs>;// The Python functions are now typed up in the eel API, as async and with callback:asyncfunctiontest(): void{constnum=awaiteel.get_number()();// num is numbereel.get_number()((num)=>console.log(num));// num is number}This software is licensed under the terms of the MIT license.