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

@@ -7,7 +7,7 @@ interface ChatTabBarProps {
tabs: ChatTab[]
activeTabId: string
onSwitch: (tabId: string) => void
onClose: (tabId: string, e?: React.MouseEvent) => void
onClose: (tabId: string, e?: React.MouseEvent | React.KeyboardEvent) => void
onAddVirtual: () => void
}
@@ -55,7 +55,7 @@ export function ChatTabBar({
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault()
onClose(tab.id, e as any)
onClose(tab.id, e)
}
}}
>