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:
parent
b043fb1980
commit
eaf187f2c4
6 changed files with 11 additions and 7 deletions
5
.changeset/perfect-islands-teach.md
Normal file
5
.changeset/perfect-islands-teach.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@astrojs/image': patch
|
||||
---
|
||||
|
||||
Fixing TypeScript definition exports for image components
|
|
@ -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';
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/// <reference types="astro/astro-jsx" />
|
||||
export type { Image, Picture } from '../components/index.js';
|
||||
export * from './index.js';
|
||||
|
||||
interface ImageIntegration {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
import socialJpg from '../assets/social.jpg';
|
||||
import { Image } from '@astrojs/image';
|
||||
import { Image } from '@astrojs/image/components';
|
||||
---
|
||||
|
||||
<html>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
import socialJpg from '../assets/social.jpg';
|
||||
import { Picture } from '@astrojs/image';
|
||||
import { Picture } from '@astrojs/image/components';
|
||||
---
|
||||
|
||||
<html>
|
||||
|
|
Loading…
Reference in a new issue