feat(plugin): add onPlayerApiReady hook

Co-authored-by: JellyBrick <shlee1503@naver.com>
This commit is contained in:
Su-Yong
2023-11-12 01:51:26 +09:00
parent 2097f42efb
commit a4f4ecb569
22 changed files with 273 additions and 291 deletions

View File

@ -2,6 +2,7 @@ import type {
BrowserWindow,
MenuItemConstructorOptions,
} from 'electron';
import type { YoutubePlayer } from '../../types/youtube-player';
export type PluginBaseConfig = {
enabled: boolean;
@ -11,7 +12,9 @@ export type BasePlugin<Config extends PluginBaseConfig> = {
onUnload?: () => void;
onConfigChange?: (newConfig: Config) => void;
}
export type RendererPlugin<Config extends PluginBaseConfig> = BasePlugin<Config>;
export type RendererPlugin<Config extends PluginBaseConfig> = BasePlugin<Config> & {
onPlayerApiReady?: (api: YoutubePlayer) => void;
};
export type MainPlugin<Config extends PluginBaseConfig> = Omit<BasePlugin<Config>, 'onLoad' | 'onUnload'> & {
onLoad?: (window: BrowserWindow) => void;
onUnload?: (window: BrowserWindow) => void;