refactor: fix type errors and improve type safety in PDF logic

- Add proper type assertions for DOM element properties
- Remove unused md-to-pdf feature
- Fix type errors in various PDF manipulation functions
- Improve type safety for HTML element interactions
This commit is contained in:
abdullahalam123 committed 2025-10-17 15:01:48 +05:30
1 parent 298135ab0d
commit cc83d7951f
18 files changed
+1033 -729

No files matched your search

+2 -10
View File
@@ -297,12 +297,7 @@ export async function compress() {
resultBytes = vectorResultBytes;
usedMethod = 'Vector (Automatic)';
} else {
// @ts-expect-error TS(2554) FIXME: Expected 2 arguments, but got 3.
showAlert(
'Vector failed to reduce size. Trying Photon...',
'info',
3000
);
showAlert('Vector failed to reduce size. Trying Photon...', 'info');
showLoader('Running Automatic (Photon fallback)...');
resultBytes = await performLegacyCompression(
arrayBuffer,
@@ -339,12 +334,9 @@ export async function compress() {
'compressed-final.pdf'
);
} catch (e) {
console.error(e);
// @ts-expect-error TS(2554) FIXME: Expected 2 arguments, but got 3.
showAlert(
'Error',
`An error occurred during compression. Error: ${e.message}`,
'error'
`An error occurred during compression. Error: ${e.message}`
);
} finally {
hideLoader();