Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Adding missing types in RequestInitCfPropertiesImage #156

Merged

Conversation

itsmatteomanf
Copy link
Contributor

Added missing types with descriptions.
Added, described and ordered following the Cloudflare Developer Docs at https://developers.cloudflare.com/images/image-resizing/resize-with-workers and https://developers.cloudflare.com/images/image-resizing/draw-overlays.

In RequestInitCfPropertiesImage:

  • trim
  • anim
  • sharpen
  • blur

In RequestInitCfPropertiesImageDraw:

  • width
  • height
  • fit
  • gravity
  • background
  • rotate

Added RequestInitCfPropertiesImageTrim:

  • left
  • top
  • right
  • bottom

Closes #141.

overrides/cf.d.ts Outdated Show resolved Hide resolved
@itsmatteomanf
Copy link
Contributor Author

In RequestInitCfPropertiesImageDraw:

  • width
  • height
  • fit
  • gravity
  • background
  • rotate

Removed, as they were brought over by the extends BasicImageTransformations part, duh.

Copy link
Member

@GregBrimble GregBrimble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And lastly, if you can update the crop docs on L55 to be:

   *  - crop: The image will shrunk and cropped to fit within the area
   *    specified by width and height. The image will not be enlarged. For images
   *    smaller than the given dimensions it is the same as scale-down. For
   *    images larger than the given dimensions, it is the same as cover.
   *    See also trim.

Thanks for contributing!

overrides/cf.d.ts Outdated Show resolved Hide resolved
overrides/cf.d.ts Outdated Show resolved Hide resolved
@itsmatteomanf
Copy link
Contributor Author

Fixes requested, done.

@GregBrimble GregBrimble merged commit 3aeee23 into cloudflare:master Nov 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Options missing in RequestInitCfPropertiesImage
2 participants