From 4da5b4b7eb4d428a6cc6c23b134f5f30d61107cf Mon Sep 17 00:00:00 2001 From: Frooodle <77850077+Frooodle@users.noreply.github.com> Date: Tue, 23 Jun 2026 16:55:54 +0100 Subject: [PATCH] fix typecheck --- .../core/services/signatureDetectionService.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/frontend/editor/src/core/services/signatureDetectionService.ts b/frontend/editor/src/core/services/signatureDetectionService.ts index cae3fed8ed..e2bdc98395 100644 --- a/frontend/editor/src/core/services/signatureDetectionService.ts +++ b/frontend/editor/src/core/services/signatureDetectionService.ts @@ -4,12 +4,7 @@ * without needing to make API calls */ -// PDF.js types (simplified) -declare global { - interface Window { - pdfjsLib?: any; - } -} +// window.pdfjsLib is declared (narrowly) in formDetection/pdfRender.ts. export interface SignatureDetectionResult { hasSignatures: boolean; @@ -29,8 +24,9 @@ const detectSignaturesInFile = async ( file: File, ): Promise => { try { - // Ensure PDF.js is available - if (!window.pdfjsLib) { + // pdfRender.ts narrowly types window.pdfjsLib; this service uses more of the API. + const pdfjsLib = window.pdfjsLib as any; + if (!pdfjsLib) { return { hasSignatures: false, error: "PDF.js not available", @@ -41,8 +37,7 @@ const detectSignaturesInFile = async ( const arrayBuffer = await file.arrayBuffer(); // Load the PDF document - const pdf = await window.pdfjsLib.getDocument({ data: arrayBuffer }) - .promise; + const pdf = await pdfjsLib.getDocument({ data: arrayBuffer }).promise; let totalSignatures = 0;