From 304aa51254a577755dcfea2035b1cce2fe67661b Mon Sep 17 00:00:00 2001 From: "Simen A. W. Olsen" Date: Wed, 31 Mar 2021 13:11:11 +0200 Subject: [PATCH 1/2] feat: Export ImageDataLike type --- packages/gatsby-plugin-image/src/components/hooks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gatsby-plugin-image/src/components/hooks.ts b/packages/gatsby-plugin-image/src/components/hooks.ts index 75357ad253dbd..ea3015a564871 100644 --- a/packages/gatsby-plugin-image/src/components/hooks.ts +++ b/packages/gatsby-plugin-image/src/components/hooks.ts @@ -57,7 +57,7 @@ const isGatsbyImageDataParent = ( node: IGatsbyImageDataParent | any ): node is IGatsbyImageDataParent => 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 From cef1234e0edd02343faefdb140efdac96aa551dc Mon Sep 17 00:00:00 2001 From: "Simen A. W. Olsen" Date: Wed, 31 Mar 2021 13:19:00 +0200 Subject: [PATCH 2/2] add to export --- packages/gatsby-plugin-image/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/gatsby-plugin-image/src/index.ts b/packages/gatsby-plugin-image/src/index.ts index eb6ee653dd5e2..5961811df1506 100644 --- a/packages/gatsby-plugin-image/src/index.ts +++ b/packages/gatsby-plugin-image/src/index.ts @@ -15,6 +15,7 @@ export { IArtDirectedImage, IGetImageDataArgs, IUrlBuilderArgs, + ImageDataLike, } from "./components/hooks" export { generateImageData,