From bca3602da2764a3ee044e0e836666b65dad435ef Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Thu, 28 Aug 2025 13:24:25 +0900 Subject: [PATCH] refactor --- .../components/MkStreamingNotificationsTimeline.vue | 2 +- packages/frontend/src/pages/flash/flash.vue | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/components/MkStreamingNotificationsTimeline.vue b/packages/frontend/src/components/MkStreamingNotificationsTimeline.vue index 93ffee8d98..15e8e2105f 100644 --- a/packages/frontend/src/components/MkStreamingNotificationsTimeline.vue +++ b/packages/frontend/src/components/MkStreamingNotificationsTimeline.vue @@ -59,7 +59,7 @@ import { isSeparatorNeeded, getSeparatorInfo } from '@/utility/timeline-date-sep import { Paginator } from '@/utility/paginator.js'; const props = defineProps<{ - excludeTypes?: typeof notificationTypes[number][]; + excludeTypes?: typeof notificationTypes[number][] | null; }>(); const rootEl = useTemplateRef('rootEl'); diff --git a/packages/frontend/src/pages/flash/flash.vue b/packages/frontend/src/pages/flash/flash.vue index 560d2a46ea..f318a9f817 100644 --- a/packages/frontend/src/pages/flash/flash.vue +++ b/packages/frontend/src/pages/flash/flash.vue @@ -196,13 +196,13 @@ async function run() { const isLegacy = !flash.value.script.replaceAll(' ', '').startsWith('///@1.0.0'); - const { Interpreter, Parser, values } = isLegacy ? await import('@syuilo/aiscript-0-19-0') : await import('@syuilo/aiscript'); + const { Interpreter, Parser, values } = isLegacy ? (await import('@syuilo/aiscript-0-19-0') as any) : await import('@syuilo/aiscript'); const parser = new Parser(); components.value = []; - aiscript.value = new Interpreter({ + const interpreter = new Interpreter({ ...createAiScriptEnv({ storageKey: 'flash:' + flash.value.id, }), @@ -221,6 +221,8 @@ async function run() { }, }); + aiscript.value = interpreter; + let ast; try { ast = parser.parse(flash.value.script); @@ -232,8 +234,8 @@ async function run() { return; } try { - await aiscript.value.exec(ast); - } catch (err) { + await interpreter.exec(ast); + } catch (err: any) { os.alert({ type: 'error', title: 'AiScript Error',