Type definitions for Zotero’s fork of PDF.js, generated automatically from the latest Zotero pdf.js source.
This repository provides up-to-date TypeScript types for plugin developers targeting the Zotero PDF reader environment.
Zotero maintains its own fork of pdf.js, with custom modifications for its built-in PDF reader.
Since this fork diverges from upstream, the standard pdfjs-dist package no longer reflects Zotero’s implementation.
To enable TypeScript development for Zotero plugins interacting with the internal PDF viewer, this project:
- Pulls the latest Zotero
pdf.jssource every day - Builds it using the official Gulp pipeline (
npx gulp dist) - Extracts and commits the generated type definitions to this repository
Tip
The zotero-types package automatically includes this repository, so you typically don’t need to install this directly.
pnpm add -D zotero-typesIf you want to use it independently:
pnpm add -D github:zotero-plugin-dev/zotero-pdfjs-types#mainzotero/pdf.js— the official Zotero fork of Mozilla PDF.jszotero-types— the comprehensive Zotero TypeScript type package that integrates this repository
graph TD
A["mozilla/pdf.js (Upstream Project)"] -->|Forked by Zotero| B["zotero/pdf.js (Customized Fork)"]
B -->|Daily sync & build types| C["zotero-pdfjs-types (Generated TS Types)"]
C -->|Integrated into| D["zotero-types (Full Zotero Type Package)"]
D -->|Used by| E["Zotero Plugin Developers (Type-safe Plugins)"]
Note
Do not manually edit files under types/. They are automatically generated and will be overwritten.
Apache 2.0 License.