1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-05 01:55:36 +02:00

refactor(frontend): Formまわりの型強化 (#16260)

* refactor(frontend): Formまわりの型強化

* fix

* avoid non-null assertion and add null check for safety

* refactor

* avoid non-null assertion and add null check for safety

* Update clip.vue

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
かっこかり
2025-07-06 19:36:11 +09:00
committed by GitHub
parent c2a01551a7
commit a8abb03d17
45 changed files with 344 additions and 239 deletions

View File

@@ -18,7 +18,7 @@ import type { Ref } from 'vue';
import { Interpreter, Parser } from '@syuilo/aiscript';
import { useWidgetPropsManager } from './widget.js';
import type { WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget.js';
import type { GetFormResultType } from '@/utility/form.js';
import type { FormWithDefault, GetFormResultType } from '@/utility/form.js';
import * as os from '@/os.js';
import { aiScriptReadline, createAiScriptEnv } from '@/aiscript/api.js';
import { $i } from '@/i.js';
@@ -31,15 +31,15 @@ const name = 'aiscriptApp';
const widgetPropsDef = {
script: {
type: 'string' as const,
type: 'string',
multiline: true,
default: '',
},
showHeader: {
type: 'boolean' as const,
type: 'boolean',
default: true,
},
};
} satisfies FormWithDefault;
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
@@ -92,7 +92,7 @@ async function run() {
os.alert({
type: 'error',
title: 'AiScript Error',
text: err.message,
text: err instanceof Error ? err.message : String(err),
});
}
}