[extension] 增加对自定义多线程扩展的支持,并更新 meta 文件

This commit is contained in:
SmallMain
2024-11-07 18:02:56 +08:00
parent b97579d9c0
commit 3f71c91904
13 changed files with 279 additions and 12 deletions

View File

@@ -0,0 +1,3 @@
// 该文件会在 Worker 初始化时执行,可在这里初始化或者引用其它脚本
// This file will be executed when the Worker is initialized, either initialize it here or require another script.
require("math.js");

View File

@@ -0,0 +1,9 @@
const { registerHandler } = require("ipc-worker.js");
export function add(x, y, callback) {
callback(x + y);
}
registerHandler("math", {
add,
});