Skip to content

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
@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.

2 participants