refactor: complete TypeScript type safety improvements

- Replace all 'any' types with proper TypeScript types throughout codebase
- Fix processedResult parameters to use PreprocessingResult interface
- Update UI modal types: app parameter (App), pluginDefaults (obsidianTypstPDFExportSettings)
- Fix dropdown components to use DropdownComponent from Obsidian API
- Replace plugin 'any' types with obsidianTypstPDFExport throughout converters
- Fix margins parameter to use proper interface structure
- Update fs parameter to use proper Node.js fs module type
- Improve error handling with proper unknown type and type guards
- Remove unused PdfEmbedProcessor and clean up imports

Achieves complete type safety with zero remaining 'any' types across src/ directory.
Provides better IDE support, compile-time error detection, and maintainability.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jarvis committed 2025-09-10 16:45:27 +02:00
1 parent bc689a6768
commit 2bd384fbd1
31 files changed
+204 -580

No files matched your search

+3 -3
View File
@@ -3,7 +3,7 @@
* Handles font selection and size configuration
*/
import { Setting, App } from 'obsidian';
import { Setting, App, DropdownComponent } from 'obsidian';
import { ModalSection, ModalState, ValidationResult } from '../modalTypes';
export class TypographySection implements ModalSection {
@@ -161,7 +161,7 @@ export class TypographySection implements ModalSection {
}
}
private addFallbackBodyFonts(dropdown: any, state: ModalState, fontType: 'body' | 'heading'): void {
private addFallbackBodyFonts(dropdown: DropdownComponent, state: ModalState, fontType: 'body' | 'heading'): void {
dropdown
.addOption('Concourse OT', 'Concourse OT')
.addOption('Times New Roman', 'Times New Roman')
@@ -189,7 +189,7 @@ export class TypographySection implements ModalSection {
});
}
private addFallbackMonospaceFonts(dropdown: any, state: ModalState): void {
private addFallbackMonospaceFonts(dropdown: DropdownComponent, state: ModalState): void {
dropdown
.addOption('Source Code Pro', 'Source Code Pro')
.addOption('Courier New', 'Courier New')