Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] TypeScript Error: Property 'customHandlerId' Not Recognized in '@pdftron/webviewer' Method 'instance.UI.loadDocument #1046

Open
ToriaHUB opened this issue Feb 19, 2024 · 1 comment

Comments

@ToriaHUB
Copy link

Description

I am currently using @pdftron/webviewer version 10.7.1 in my project. I encountered an issue where TypeScript does not recognize the customHandlerId property in the instance.UI.loadDocument method.

WebViewer version
10.7.1

The current behavior
TypeScript does not recognize customHandlerId as a valid property in the instance.UI.loadDocument method and throws an error.

The expected behavior
customHandlerId should be recognized by TypeScript as a valid property in the instance.UI.loadDocument method.

Steps to reproduce

  1. Install @pdftron/webviewer version 10.7.1.
  2. Use the customHandlerId property in the instance.UI.loadDocument method in your code.
  3. TypeScript will show an error indicating that customHandlerId does not exist in the type definitions.

Possible Solution

Update the type definitions to include customHandlerId as a valid property in the instance.UI.loadDocument method.

Additional Context

I am using TypeScript version 4.9.5 and Node.js version 20.x.x on macOS.

My Environment

  • OS: macOS
  • Node.js version: 20.x.x
  • TypeScript version: 4.9.5
  • @pdftron/webviewer version: 10.7.1
@bollain
Copy link
Collaborator

bollain commented Feb 21, 2024

Hi @ToriaHUB,

Thanks for this report. I will add an item to our backlog to fix this doc. In the meantime, you can also use loadDocument from the documentViewer itself; looking at that code I see that customHandlerId is properly documented there. The UI method is just a wrapper for the method from the documentViewer.

Example:

const { documentViewer } = instance.Core;
documentViewer.loadDocument(....)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants