Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 2.76 KB

File metadata and controls

60 lines (40 loc) · 2.76 KB

📄 zotero-pdfjs-types

Build Status Last Update Last Update (pdf.js) Repo Size Types Included in zotero-types

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.

🧩 Background

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.js source every day
  • Builds it using the official Gulp pipeline (npx gulp dist)
  • Extracts and commits the generated type definitions to this repository

📦 Usage

Tip

The zotero-types package automatically includes this repository, so you typically don’t need to install this directly.

pnpm add -D zotero-types

If you want to use it independently:

pnpm add -D github:zotero-plugin-dev/zotero-pdfjs-types#main

🧭 Relationship to Other Projects

  • zotero/pdf.js — the official Zotero fork of Mozilla PDF.js
  • zotero-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)"]
Loading

🧑‍💻 For Contributors

Note

Do not manually edit files under types/. They are automatically generated and will be overwritten.

🪪 License

Apache 2.0 License.