Skip to content

Commit

Permalink
Merge pull request #34 from tinloof/tin-628-fix-sanityimage-types
Browse files Browse the repository at this point in the history
Fix SanityImage types
  • Loading branch information
thomasKn authored Apr 25, 2024
2 parents aa7cb39 + 5fe8baf commit b782f30
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/bright-hotels-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tinloof/sanity-web": patch
---

Fix SanityImage types
17 changes: 16 additions & 1 deletion packages/sanity-web/src/components/SanityImage.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
import type { ImageUrlBuilder, ImageCrop, ImageHotspot } from "sanity";
import type { ImageUrlBuilder } from "sanity";

import { getImageDimensions } from "@sanity/asset-utils";
import imageUrlBuilder from "@sanity/image-url";
import React from "react";

type ImageCrop = {
_type: "sanity.imageCrop";
top?: number;
bottom?: number;
left?: number;
right?: number;
};

type ImageHotspot = {
_type: "sanity.imageHotspot";
x?: number;
y?: number;
height?: number;
width?: number;
};
export type SanityImageProps = {
/** The aspect ratio of the image, in the format of `width/height`.
*
Expand Down

0 comments on commit b782f30

Please sign in to comment.