Skip to content

Commit

Permalink
Fixing TypeScript type definitions for image components (#3980)
Browse files Browse the repository at this point in the history
* moving back to importing from components directory

* exporting components with a .ts file instead of .js

* chore: changeset
  • Loading branch information
Tony Sullivan authored Jul 20, 2022
1 parent b043fb1 commit eaf187f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/perfect-islands-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/image': patch
---

Fixing TypeScript definition exports for image components
8 changes: 4 additions & 4 deletions packages/integrations/image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default {

```html
---
import { Image } from '@astrojs/image';
import { Image } from '@astrojs/image/components';
import heroImage from '../assets/hero.png';
---

Expand Down Expand Up @@ -132,7 +132,7 @@ import heroImage from '../assets/hero.png';

```html
---
import { Image } from '@astrojs/image';
import { Image } from '@astrojs/image/components';

const imageUrl = 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png';
---
Expand All @@ -156,7 +156,7 @@ const imageUrl = 'https://www.google.com/images/branding/googlelogo/2x/googlelog
```html
---
setup: |
import { Image } from '@astrojs/image'
import { Image } from '@astrojs/image/components'
import hero from '../../assets/blog/introducing-astro.jpg'
title: Hello world!
publishDate: 12 Sep 2021
Expand All @@ -181,7 +181,7 @@ description: Just a Hello World Post!

```html
---
import { Picture } from '@astrojs/image';
import { Picture } from '@astrojs/image/components';
import hero from '../assets/hero.png';

const imageUrl = 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png';
Expand Down
1 change: 0 additions & 1 deletion packages/integrations/image/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="astro/astro-jsx" />
export type { Image, Picture } from '../components/index.js';
export * from './index.js';

interface ImageIntegration {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import socialJpg from '../assets/social.jpg';
import { Image } from '@astrojs/image';
import { Image } from '@astrojs/image/components';
---

<html>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import socialJpg from '../assets/social.jpg';
import { Picture } from '@astrojs/image';
import { Picture } from '@astrojs/image/components';
---

<html>
Expand Down

0 comments on commit eaf187f

Please sign in to comment.