refactor(types): eliminate all as any type assertions (30 → 0)

- Replace MouseEvent-only handlers with MouseEvent | KeyboardEvent unions in multi-select and ChatTabBar
- Define LegacyInstalledPlugin type for backward compatibility in plugin-api
- Create getTokenValue() helper for type-safe theme token access in AppearanceTab
- Define ModelConfig interface for model configuration type safety in modelProvider
- All modifications maintain exact business logic equivalence
- Build passes with zero TypeScript errors (bun run build )
- LSP diagnostics clean on all modified files
This commit is contained in:
DrSmoothl
2026-03-01 21:33:40 +08:00
parent c45ee1a98e
commit ba47069dfe
7 changed files with 117 additions and 58 deletions

View File

@@ -79,7 +79,7 @@ function SortableBadge({
}
// 处理删除按钮点击,阻止事件冒泡和默认行为
const handleRemoveClick = (e: React.MouseEvent) => {
const handleRemoveClick = (e: React.MouseEvent | React.KeyboardEvent) => {
e.preventDefault()
e.stopPropagation()
onRemove(value)
@@ -121,7 +121,7 @@ function SortableBadge({
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault()
handleRemoveClick(e as any)
handleRemoveClick(e)
}
}}
>