Fixing TypeScript type definitions for image components (#3980)

* moving back to importing from components directory

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

* chore: changeset
This commit is contained in:
Tony Sullivan 2022-07-20 00:33:11 +00:00 committed by GitHub
parent b043fb1980
commit eaf187f2c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 7 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/image': patch
---
Fixing TypeScript definition exports for image components

View file

@ -104,7 +104,7 @@ export default {
```html
---
import { Image } from '@astrojs/image';
import { Image } from '@astrojs/image/components';
import heroImage from '../assets/hero.png';
---
@ -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';
---
@ -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
@ -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';

View file

@ -1,5 +1,4 @@
/// <reference types="astro/astro-jsx" />
export type { Image, Picture } from '../components/index.js';
export * from './index.js';
interface ImageIntegration {

View file

@ -1,6 +1,6 @@
---
import socialJpg from '../assets/social.jpg';
import { Image } from '@astrojs/image';
import { Image } from '@astrojs/image/components';
---
<html>

View file

@ -1,6 +1,6 @@
---
import socialJpg from '../assets/social.jpg';
import { Picture } from '@astrojs/image';
import { Picture } from '@astrojs/image/components';
---
<html>