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

Better content typing #16

Merged
merged 2 commits into from
Jul 5, 2024
Merged

Better content typing #16

merged 2 commits into from
Jul 5, 2024

Conversation

DanielArnould
Copy link
Owner

Since content isn't actually needed for anything in the PdfHighlighter, it should be removed from the Highlight type. As stated in #5 , for large numbers of highlights, especially images, this can be beneficial for performance and storage since image content no longer needs to be loaded on every render or stored in a database if not required.

Since developers might already be using content to determine whether a highlight is an area highlight or text highlight, we simply add a new type property that makes this explicit. However, to avoid any breaking changes, type has been marked as optional and content is kept in Highlight but made optional.

Make content optional on Highlight.
@DanielArnould DanielArnould merged commit d80742c into main Jul 5, 2024
1 check passed
@DanielArnould DanielArnould deleted the better-content-typing branch July 5, 2024 09:03
@DanielArnould DanielArnould mentioned this pull request Jul 5, 2024
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

Successfully merging this pull request may close these issues.

1 participant