first commit
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Types tests / Test (lts/*) (push) Has been cancelled
				
			
		
			
				
	
				Lint / Lint (lts/*) (push) Has been cancelled
				
			
		
			
				
	
				CodeQL / Analyze (javascript) (push) Has been cancelled
				
			
		
			
				
	
				CI / Test (20) (push) Has been cancelled
				
			
		
			
				
	
				CI / Test (22) (push) Has been cancelled
				
			
		
			
				
	
				CI / Test (24) (push) Has been cancelled
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Types tests / Test (lts/*) (push) Has been cancelled
				
			Lint / Lint (lts/*) (push) Has been cancelled
				
			CodeQL / Analyze (javascript) (push) Has been cancelled
				
			CI / Test (20) (push) Has been cancelled
				
			CI / Test (22) (push) Has been cancelled
				
			CI / Test (24) (push) Has been cancelled
				
			This commit is contained in:
		
							
								
								
									
										23
									
								
								test/types/legacy.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								test/types/legacy.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
import { getDocument } from "pdfjs-dist/legacy/build/pdf.mjs";
 | 
			
		||||
import { EventBus } from "pdfjs-dist/legacy/web/pdf_viewer.mjs";
 | 
			
		||||
 | 
			
		||||
class MainTest {
 | 
			
		||||
  eventBus: EventBus;
 | 
			
		||||
  task: ReturnType<typeof getDocument> | undefined;
 | 
			
		||||
 | 
			
		||||
  constructor(public file: string) {
 | 
			
		||||
    this.eventBus = new EventBus();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  loadPdf() {
 | 
			
		||||
    this.task = getDocument("file://" + this.file);
 | 
			
		||||
    return this.task.promise;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// This is actually never called, as the test only consists in compiling the file.
 | 
			
		||||
// The compilation will crawl through all files and make sure that the types are consistent.
 | 
			
		||||
const mt = new MainTest("../pdfs/basicapi.pdf");
 | 
			
		||||
mt.loadPdf().then(() => {
 | 
			
		||||
  console.log("loaded");
 | 
			
		||||
});
 | 
			
		||||
		Reference in New Issue
	
	Block a user