diff --git a/app/web/src/nova/ed/panel/popup/script/scope/scope.tsx b/app/web/src/nova/ed/panel/popup/script/scope/scope.tsx index 174567b2..eef65a2b 100644 --- a/app/web/src/nova/ed/panel/popup/script/scope/scope.tsx +++ b/app/web/src/nova/ed/panel/popup/script/scope/scope.tsx @@ -192,16 +192,15 @@ return typings; i++; if (v.mode === "local") { const im = tree_types.length; - const fn = new Function(`return ${v.val}`); const local_type = `\ declare module "item-${im}" { - export const \$\$_${k} = ${fn.toString()}; + export const \$\$_${k} = v.val; } `; tree_types.push(local_type); tree_usage.push({ import: `import { \$\$_${k} } from "item-${im}";`, - usage: `const ${k} = null as unknown as (ReturnType & { render: ()=> void }); `, + usage: `const ${k} = null as unknown as (typeof \$\$_${k} & { render: ()=> void }); `, }); } else if (v.mode === "prop") { const im = tree_types.length;