Skip to content

Commit

Permalink
feat(gatsby-plugin-image): Export ImageDataLike type (#30590)
Browse files Browse the repository at this point in the history
Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
  • Loading branch information
simenandre and gatsbybot committed May 6, 2021
1 parent aa09e6f commit dad0032
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-image/src/components/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const isGatsbyImageDataParent = <T>(
node: IGatsbyImageDataParent<T> | any
): node is IGatsbyImageDataParent<T> => Boolean(node?.gatsbyImageData)

type ImageDataLike = FileNode | IGatsbyImageDataParent | IGatsbyImageData
export type ImageDataLike = FileNode | IGatsbyImageDataParent | IGatsbyImageData
export const getImage = (node: ImageDataLike): IGatsbyImageData | undefined => {
if (isGatsbyImageData(node)) {
return node
Expand Down
1 change: 1 addition & 0 deletions packages/gatsby-plugin-image/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export {
IArtDirectedImage,
IGetImageDataArgs,
IUrlBuilderArgs,
ImageDataLike,
} from "./components/hooks"
export {
generateImageData,
Expand Down

0 comments on commit dad0032

Please sign in to comment.