refactor: improve type safety by removing 'as any' casts
Created database.ts with proper database result types and replaced 38+ 'as any' casts throughout the codebase with proper type annotations. Changes: - Created src/types/database.ts with TableColumnInfo, IndexInfo, and database record types - Fixed all type casts in SessionStore.ts (migrations, query results) - Fixed type casts in SessionSearch.ts, SettingsManager.ts, SettingsRoutes.ts - Improved MCP server JSON schema typing All builds pass and worker service runs successfully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,7 @@ export class SettingsManager {
|
||||
for (const row of rows) {
|
||||
const key = row.key as keyof ViewerSettings;
|
||||
if (key in settings) {
|
||||
(settings as any)[key] = JSON.parse(row.value);
|
||||
settings[key] = JSON.parse(row.value) as ViewerSettings[typeof key];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user