HF / console /src /utils /pywebview.ts
mysticaldragon's picture
Deploy QwenPaw - Personal AI Assistant Platform
4e7644b
Raw History Blame Contribute Delete
469 Bytes
/**
* Shared access point for the legacy pywebview desktop bridge.
* Keeping the bridge type here prevents runtime helpers from drifting apart.
*/
export type PyWebViewApi = NonNullable<Window["pywebview"]>["api"];
export type PyWebViewSaveFile = NonNullable<PyWebViewApi["save_file"]>;
/** Return the legacy pywebview bridge when the old desktop shell injects it. */
export function getPyWebViewApi(): PyWebViewApi | undefined {
return window.pywebview?.api;
}