[ ] Chore (a non-breaking change which is related to package maintenance)
[x] Bug fix (a non-breaking change which fixes an issue)
[ ] New feature (a non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Description
Union with image thumbnails were not handled correctly with TypeScript. This PR fixes it by refactoring the type, extending the root image object with thumbnails, and wrapping it with Omit<> to prevent TypeScript from considering the refactored type as an array (found by @angeloashmore).
Just created a PR to make sure we're aligned on it before moving forward with this "hacky" method. The goal of @prismicio/types being to provide types as close and precise as possible to what Prismic API responses can be.
Resolves: #27
Checklist:
[ ] My change requires an update to the official documentation.
[x] All TSDoc comments are up-to-date and new ones have been added where necessary.
Types of changes
Description
Union with image thumbnails were not handled correctly with TypeScript. This PR fixes it by refactoring the type, extending the root image object with thumbnails, and wrapping it with
Omit<>
to prevent TypeScript from considering the refactored type as an array (found by @angeloashmore).Just created a PR to make sure we're aligned on it before moving forward with this "hacky" method. The goal of
@prismicio/types
being to provide types as close and precise as possible to what Prismic API responses can be.Resolves: #27
Checklist: