refactor: convert map feature to strict TypeScript

This commit is contained in:
sjg
2026-08-01 13:39:41 +02:00
parent 0338c8b8d2
commit 82121491c5
8 changed files with 3606 additions and 3451 deletions
File diff suppressed because it is too large Load Diff
@@ -10,25 +10,11 @@ const pluginGroups = {
};
const loaded = /* @__PURE__ */ new Set();
const loading = /* @__PURE__ */ new Map();
const modulePlugins = /* @__PURE__ */ new Set(["/ft8.js", "/ft4.js", "/ft2.js", "/wspr.js", "/cw.js", "/vdes.js", "/wefax.js", "/background-decode.js", "/ais.js", "/aprs.js", "/hf-aprs.js", "/sat.js", "/sat-scheduler.js", "/vchan.js", "/bookmarks.js", "/scheduler.js"]);
function loadLegacyScript(path) {
return new Promise((resolve, reject) => {
const script = document.createElement("script");
script.src = path;
script.addEventListener("load", () => {
resolve();
}, { once: true });
script.addEventListener("error", () => {
reject(new Error(`Failed to load plugin script: ${path}`));
}, { once: true });
document.body.appendChild(script);
});
}
async function loadPlugin(path) {
if (loaded.has(path)) return;
const pending = loading.get(path);
if (pending) return pending;
const request = (modulePlugins.has(path) ? import(path).then(() => void 0) : loadLegacyScript(path)).then(() => {
const request = import(path).then(() => {
loaded.add(path);
loading.delete(path);
}).catch((error) => {