mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-06 08:08:38 +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:
@@ -34,9 +34,10 @@ export async function removeAnnotations() {
|
||||
const totalPages = state.pdfDoc.getPageCount();
|
||||
let targetPageIndices = [];
|
||||
|
||||
// @ts-expect-error TS(2339) FIXME: Property 'value' does not exist on type 'Element'.
|
||||
const pageScope = document.querySelector(
|
||||
'input[name="page-scope"]:checked'
|
||||
const pageScope = (
|
||||
document.querySelector(
|
||||
'input[name="page-scope"]:checked'
|
||||
) as HTMLInputElement
|
||||
).value;
|
||||
if (pageScope === 'all') {
|
||||
targetPageIndices = Array.from({ length: totalPages }, (_, i) => i);
|
||||
@@ -71,9 +72,8 @@ export async function removeAnnotations() {
|
||||
throw new Error('No valid pages were selected.');
|
||||
|
||||
const typesToRemove = new Set(
|
||||
// @ts-expect-error TS(2339) FIXME: Property 'value' does not exist on type 'Element'.
|
||||
Array.from(document.querySelectorAll('.annot-checkbox:checked')).map(
|
||||
(cb) => cb.value
|
||||
(cb) => (cb as HTMLInputElement).value
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user