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:
31 files changed
+204
-580
No files matched your search
@@ -3,8 +3,9 @@
|
||||
* Handles registration of all plugin event handlers and menu items
|
||||
*/
|
||||
|
||||
import { Menu, Editor, MarkdownView, TFile, TAbstractFile, Notice } from 'obsidian';
|
||||
import { Menu, Editor, MarkdownView, TFile, TAbstractFile } from 'obsidian';
|
||||
import type { obsidianTypstPDFExport } from '../../main';
|
||||
import { ExportErrorHandler } from '../core/ExportErrorHandler';
|
||||
|
||||
export class EventHandlers {
|
||||
constructor(private plugin: obsidianTypstPDFExport) {}
|
||||
@@ -79,7 +80,7 @@ export class EventHandlers {
|
||||
const activeView = this.plugin.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
|
||||
if (!activeView || !activeView.file) {
|
||||
new Notice('Please open a markdown file to export');
|
||||
ExportErrorHandler.showFileNotFoundWarning('markdown');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user