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
@@ -17,6 +17,7 @@ import {
|
||||
|
||||
import { obsidianTypstPDFExportSettings, DEFAULT_SETTINGS } from './src/core/settings';
|
||||
import { DependencyChecker } from './src/core/DependencyChecker';
|
||||
import type { PreprocessingResult } from './src/converters/MarkdownPreprocessor';
|
||||
import { ExportErrorHandler } from './src/core/ExportErrorHandler';
|
||||
import { PandocTypstConverter } from './src/converters/PandocTypstConverter';
|
||||
import { TemplateManager } from './src/templates/TemplateManager';
|
||||
@@ -194,21 +195,21 @@ export class obsidianTypstPDFExport extends Plugin {
|
||||
/**
|
||||
* Process PDF embeds (delegated to EmbedProcessor)
|
||||
*/
|
||||
async processPdfEmbeds(processedResult: any, vaultBasePath: string, tempDir: string, currentFile?: TFile, embedPdfFiles: boolean = true): Promise<void> {
|
||||
async processPdfEmbeds(processedResult: PreprocessingResult, vaultBasePath: string, tempDir: string, currentFile?: TFile, embedPdfFiles: boolean = true): Promise<void> {
|
||||
return this.embedProcessor.processPdfEmbeds(processedResult, vaultBasePath, tempDir, currentFile, embedPdfFiles);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process image embeds (delegated to EmbedProcessor)
|
||||
*/
|
||||
async processImageEmbeds(processedResult: any, vaultBasePath: string, tempDir: string, currentFile?: TFile): Promise<void> {
|
||||
async processImageEmbeds(processedResult: PreprocessingResult, vaultBasePath: string, tempDir: string, currentFile?: TFile): Promise<void> {
|
||||
return this.embedProcessor.processImageEmbeds(processedResult, vaultBasePath, tempDir, currentFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process file embeds (delegated to EmbedProcessor)
|
||||
*/
|
||||
async processFileEmbeds(processedResult: any, vaultBasePath: string, tempDir: string, currentFile?: TFile, embedAllFiles: boolean = true): Promise<void> {
|
||||
async processFileEmbeds(processedResult: PreprocessingResult, vaultBasePath: string, tempDir: string, currentFile?: TFile, embedAllFiles: boolean = true): Promise<void> {
|
||||
return this.embedProcessor.processFileEmbeds(processedResult, vaultBasePath, tempDir, currentFile, embedAllFiles);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user