Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gatsby-plugin-image): Export ImageDataLike type #30590

Merged
merged 3 commits into from
May 6, 2021
Merged

feat(gatsby-plugin-image): Export ImageDataLike type #30590

merged 3 commits into from
May 6, 2021

Conversation

simenandre
Copy link
Contributor

@simenandre simenandre commented Mar 31, 2021

Description

This pull request adds ImageDataLike as an exported type.

In cases where developers want to create a component that takes in the same argument as getImage, getSrc or getSrcSet there is currently no way to reference the same types that these functions use. This Pull Request fixes that.

Documentation

Example

import { ImageDataLike, getImage } from 'gatsby-plugin-image';

export interface MyComponentProps {
	image: ImageDataLike
}

const MyComponent: React.FC<MyComponentProps> = ({ image }) => {
	const img = getImage(image);
}

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 31, 2021
@LekoArts LekoArts added topic: media Related to gatsby-plugin-image, or general image/media processing topics and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Apr 6, 2021
@simenandre
Copy link
Contributor Author

simenandre commented Apr 27, 2021

Is there anything I can do to conclude this? Describe it further/better? Add some documentation? :)

I wanna know how I am going to close some other issues related to this 👍

Copy link
Contributor

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

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

Thanks!

@ascorbic ascorbic changed the title feat: Export ImageDataLike type feat(gatsby-plugin-image): Export ImageDataLike type Apr 28, 2021
@LekoArts LekoArts merged commit dad0032 into gatsbyjs:master May 6, 2021
moonmeister added a commit to moonmeister/gatsby that referenced this pull request May 7, 2021
* master: (45 commits)
  chore(release): Publish next pre-minor
  fix(gatsby-source-shopify): fix linting (gatsbyjs#31291)
  fix(deps): update minor and patch for gatsby-plugin-preact (gatsbyjs#31169)
  chore: add gatsby-plugin-gatsby-cloud to renovate
  chore: update renovatebot config to support more packages (gatsbyjs#31289)
  chore(deps): update dependency @types/semver to ^7.3.5 (gatsbyjs#31148)
  fix(deps): update minor and patch for gatsby-plugin-manifest (gatsbyjs#31160)
  fix(deps): update minor and patch for gatsby-remark-copy-linked-files (gatsbyjs#31163)
  fix(deps): update dependency mini-css-extract-plugin to v1.6.0 (gatsbyjs#31158)
  chore(deps): update dependency @testing-library/react to ^11.2.6 (gatsbyjs#31168)
  docs(gatsby-source-shopify): Updates Shopify README with new plugin info (gatsbyjs#31287)
  chore: run yarn deduplicate (gatsbyjs#31285)
  docs(gatsby-plugin-image): Add docs for customizing default options (gatsbyjs#30344)
  fix(gatsby-plugin-image): print error details (gatsbyjs#30417)
  chore(docs): Update "Adding Search with Algolia" guide (gatsbyjs#29460)
  chore(docs): Update MDX frontmatter for programmatic pages (gatsbyjs#29798)
  docs: Add image plugin architecture doc (gatsbyjs#31096)
  perf(gatsby): use fastq instead of better-queue + refactor (gatsbyjs#31269)
  feat(gatsby-plugin-image): Export ImageDataLike type (gatsbyjs#30590)
  fix(gatsby): update plugin api types (gatsbyjs#30819)
  ...
axe312ger pushed a commit that referenced this pull request May 20, 2021
Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
mnvr added a commit to mnvr/mrmr.io that referenced this pull request Jan 3, 2024
Added in: gatsbyjs/gatsby#30590

> ImageDataLike is an exported type, for cases where we want to create a
  component that takes the same argument as `getImage`, `getSrc` or `getSrcSet`,
  and so wants to reference the same type that these functions use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: media Related to gatsby-plugin-image, or general image/media processing topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants