// Type definitions for PDF.js library
// Minimal types to support our PDF viewer functionality

declare module 'pdfjs-dist' {
  interface PDFDocumentProxy {
    getPage(pageNumber: number): Promise<PDFPageProxy>;
    numPages: number;
    destroy(): void;
  }

  interface PDFPageProxy {
    getViewport(options: { scale: number }): { width: number; height: number };
    render(options: {
      canvasContext: CanvasRenderingContext2D;
      viewport: any;
      renderQuality?: string;
    }): { promise: Promise<void> };
    cleanup(): void;
  }

  interface PDFDocumentLoadingTask {
    promise: Promise<PDFDocumentProxy>;
  }

  function getDocument(options: { url: string }): PDFDocumentLoadingTask;

  // Global worker options
  const GlobalWorkerOptions: {
    workerSrc: string;
  };
}

// Extend Window interface for PDF.js global
declare global {
  interface Window {
    pdfjsLib: any;
  }
}