mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-12 01:33:36 +01:00
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:
1 parent
298135ab0d
commit
cc83d7951f
18 files changed
+1033
-729
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user