-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
These definitions do not work with Web Views. According to the docs, a Web View does not get access to the full iina API, but have instead access to window.iina which has onMessage and postMessage defined.
I'm not sure the best approach for supporting multiple environments like this. I've worked around this in my project with this short definition:
declare namespace IINA {
export type WebViewGlobal = {
postMessage(name: string, data: any): void;
onMessage(name: string, callback: (data: any) => void): void;
};
}
declare global {
interface Window {
iina: IINA.WebViewGlobal;
}
}This works well as long as I prefix calls with window.iina.
I haven't dug too deeply into preferences yet, but I assume they have a different API surface area as well.
Metadata
Metadata
Assignees
Labels
No labels