/
githubmirror
/
pdf.js
Обзор
Документация
Войти
/
githubmirror
/
pdf.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/types/modern.ts
23 строки
663 B
Jonas Jenwald
[api-major] Remove support for calling `getDocument` without a parameter object
09 май 2026, 14:00
09 май 2026, 14:00
2e7a221
Код
Авторство
О чём код?
import { getDocument } from "pdfjs-dist"; import { EventBus } from "pdfjs-dist/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({ url: "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"); });