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

chore(gatsby-image): Add missing type definitions for GatsbyImageProps #18916

Merged
merged 6 commits into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/gatsby-image/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface GatsbyImageProps {
fixed?: FixedObject | FixedObject[]
fluid?: FluidObject | FluidObject[]
fadeIn?: boolean
durationFadeIn?: number
title?: string
alt?: string
className?: string | object
Expand All @@ -38,11 +39,12 @@ interface GatsbyImageProps {
style?: object
imgStyle?: object
placeholderStyle?: object
placeholderClassName?: string
backgroundColor?: string | boolean
onLoad?: () => void
onStartLoad?: (param: { wasCached: boolean }) => void
onError?: (event: any) => void
onClick?: () => void
onStartLoad?: (param: { wasCached: boolean }) => void
Tag?: string
itemProp?: string
loading?: `auto` | `lazy` | `eager`
Expand Down
4 changes: 4 additions & 0 deletions packages/gatsby-image/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,10 @@ const fluidObject = PropTypes.shape({
media: PropTypes.string,
})

// If you modify these propTypes, please don't forget to update following files as well:
// https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-image/index.d.ts
// https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-image/README.md#gatsby-image-props
// https://github.com/gatsbyjs/gatsby/blob/master/docs/docs/gatsby-image.md#gatsby-image-props
Image.propTypes = {
resolutions: fixedObject,
sizes: fluidObject,
Expand Down
4 changes: 4 additions & 0 deletions packages/gatsby-image/src/withIEPolyfill/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ class ImageWithIEPolyfill extends Component {
}
}

// If you modify these propTypes, please don't forget to update following files as well:
// https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-image/withIEPolyfill/index.d.ts
// https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-image/README.md#gatsby-image-props
// https://github.com/gatsbyjs/gatsby/blob/master/docs/docs/gatsby-image.md#gatsby-image-props
ImageWithIEPolyfill.propTypes = {
objectFit: PropTypes.string,
objectPosition: PropTypes.string,
Expand Down