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
@@ -63,7 +63,7 @@ export class ExportOrchestrator {
|
||||
async showExportModal(view: MarkdownView): Promise<void> {
|
||||
const file = view.file;
|
||||
if (!file) {
|
||||
new Notice('No active file to export');
|
||||
ExportErrorHandler.showFileNotFoundWarning('markdown');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ export class ExportOrchestrator {
|
||||
*/
|
||||
async showExportModalForFiles(files: TFile[]): Promise<void> {
|
||||
if (files.length === 0) {
|
||||
new Notice('No files to export');
|
||||
ExportErrorHandler.showNoFilesWarning();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -229,14 +229,14 @@ export class ExportOrchestrator {
|
||||
progressNotice.hide();
|
||||
|
||||
if (result.success) {
|
||||
new Notice(`PDF exported successfully to ${result.outputPath}`);
|
||||
ExportErrorHandler.showExportSuccess(result.outputPath!);
|
||||
|
||||
// Open PDF if configured
|
||||
if (this.plugin.settings.behavior.openAfterExport) {
|
||||
this.plugin.openPDF(result.outputPath!);
|
||||
}
|
||||
} else {
|
||||
new Notice(`Export failed: ${result.error}`);
|
||||
ExportErrorHandler.handleSingleExportError(result.error!);
|
||||
}
|
||||
} catch (error) {
|
||||
ExportErrorHandler.handleSingleExportError(error);
|
||||
@@ -273,7 +273,7 @@ export class ExportOrchestrator {
|
||||
exportFunction: (file: TFile) => Promise<void>
|
||||
): Promise<void> {
|
||||
if (files.length === 0) {
|
||||
new Notice('No files to export');
|
||||
ExportErrorHandler.showNoFilesWarning();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user