Developing with TypeScript#
If you are using TypeScript for your development you should create a tsconfig.json
file at the root of your project with the minimal configuration:
{
"compilerOptions": {
"module": "nodenext"
}
}
To ensure you can work with the
mupdf
module either work withmts
files in TypeScript or usets
files and add to yourpackage.json
the following:
"type": "module"
When compiling the TypeScript to JavaScript use the following to trigger the compiler:
tsc
IDE auto-completion#
If using Visual Studio Code the MuPDF TypeScript API (derived from node_modules/mupdf/dist/mupdf.d.ts
) should be exposed for your use and IDE code prompts will suggest available methods against mupdf
objects.
Was this page helpful?