mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-17 08:47:49 +00:00
8c8cf180fa
* Add an updater in settings for decky-loader * add chmod * remove junk comments
29 lines
767 B
TypeScript
29 lines
767 B
TypeScript
import PluginLoader from './plugin-loader';
|
|
import { DeckyUpdater } from './updater';
|
|
|
|
declare global {
|
|
interface Window {
|
|
DeckyPluginLoader: PluginLoader;
|
|
DeckyUpdater?: DeckyUpdater;
|
|
importDeckyPlugin: Function;
|
|
syncDeckyPlugins: Function;
|
|
}
|
|
}
|
|
|
|
window.DeckyPluginLoader?.dismountAll();
|
|
window.DeckyPluginLoader?.deinit();
|
|
|
|
window.DeckyPluginLoader = new PluginLoader();
|
|
window.importDeckyPlugin = function (name: string) {
|
|
window.DeckyPluginLoader?.importPlugin(name);
|
|
};
|
|
|
|
window.syncDeckyPlugins = async function () {
|
|
const plugins = await (await fetch('http://127.0.0.1:1337/plugins')).json();
|
|
for (const plugin of plugins) {
|
|
window.DeckyPluginLoader?.importPlugin(plugin);
|
|
}
|
|
};
|
|
|
|
setTimeout(() => window.syncDeckyPlugins(), 5000);
|