mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
@ -4,13 +4,13 @@ import { rendererPlugins } from 'virtual:plugins';
|
||||
|
||||
import { RendererContext } from '@/types/contexts';
|
||||
|
||||
import { PluginDef } from '@/types/plugins';
|
||||
import { PluginConfig, PluginDef } from '@/types/plugins';
|
||||
import { startPlugin, stopPlugin } from '@/utils';
|
||||
|
||||
const unregisterStyleMap: Record<string, (() => void)[]> = {};
|
||||
const loadedPluginMap: Record<string, PluginDef> = {};
|
||||
const loadedPluginMap: Record<string, PluginDef<unknown, unknown, unknown, PluginConfig>> = {};
|
||||
|
||||
const createContext = (id: string): RendererContext => ({
|
||||
const createContext = <Config extends PluginConfig>(id: string): RendererContext<Config> => ({
|
||||
getConfig: () => window.mainConfig.plugins.getOptions(id),
|
||||
setConfig: async (newConfig) => {
|
||||
await window.ipcRenderer.invoke('set-config', id, newConfig);
|
||||
|
||||
Reference in New Issue
Block a user