diff --git a/packages/integrations/image/client.d.ts b/packages/integrations/image/client.d.ts index c736d2f44..5809298ab 100644 --- a/packages/integrations/image/client.d.ts +++ b/packages/integrations/image/client.d.ts @@ -1,13 +1,4 @@ -type InputFormat = - | 'avif' - | 'gif' - | 'heic' - | 'heif' - | 'jpeg' - | 'jpg' - | 'png' - | 'tiff' - | 'webp'; +type InputFormat = 'avif' | 'gif' | 'heic' | 'heif' | 'jpeg' | 'jpg' | 'png' | 'tiff' | 'webp'; interface ImageMetadata { src: string; diff --git a/packages/integrations/image/components/index.ts b/packages/integrations/image/components/index.ts index 088278fc2..89d8edd03 100644 --- a/packages/integrations/image/components/index.ts +++ b/packages/integrations/image/components/index.ts @@ -3,5 +3,11 @@ export { default as Image } from './Image.astro'; export { default as Picture } from './Picture.astro'; // TODO: should these directives be removed from astroHTML.JSX? -export type ImgHTMLAttributes = Omit; -export type HTMLAttributes = Omit; +export type ImgHTMLAttributes = Omit< + astroHTML.JSX.ImgHTMLAttributes, + 'client:list' | 'set:text' | 'set:html' | 'is:raw' +>; +export type HTMLAttributes = Omit< + astroHTML.JSX.HTMLAttributes, + 'client:list' | 'set:text' | 'set:html' | 'is:raw' +>; diff --git a/packages/integrations/image/src/index.ts b/packages/integrations/image/src/index.ts index 234b1646d..78f3d3f4e 100644 --- a/packages/integrations/image/src/index.ts +++ b/packages/integrations/image/src/index.ts @@ -9,7 +9,7 @@ import { createPlugin } from './vite-plugin-astro-image.js'; export { getImage } from './lib/get-image.js'; export { getPicture } from './lib/get-picture.js'; export * from './loaders/index.js'; -export type { ImageMetadata} from './vite-plugin-astro-image.js'; +export type { ImageMetadata } from './vite-plugin-astro-image.js'; interface ImageIntegration { loader?: ImageService; diff --git a/packages/integrations/image/src/lib/get-image.ts b/packages/integrations/image/src/lib/get-image.ts index 0a28ff3ac..9ec58795b 100644 --- a/packages/integrations/image/src/lib/get-image.ts +++ b/packages/integrations/image/src/lib/get-image.ts @@ -1,13 +1,8 @@ /// import slash from 'slash'; import { ROUTE_PATTERN } from '../constants.js'; +import { ImageService, isSSRService, OutputFormat, TransformOptions } from '../loaders/index.js'; import sharp from '../loaders/sharp.js'; -import { - ImageService, - isSSRService, - OutputFormat, - TransformOptions, -} from '../loaders/index.js'; import { isRemoteImage, parseAspectRatio } from '../utils/images.js'; import { ImageMetadata } from '../vite-plugin-astro-image.js'; @@ -101,7 +96,9 @@ async function resolveTransform(input: GetImageTransform): Promise` element. */ -export async function getImage(transform: GetImageTransform): Promise { +export async function getImage( + transform: GetImageTransform +): Promise { if (!transform.src) { throw new Error('[@astrojs/image] `src` is required'); } diff --git a/packages/integrations/image/src/loaders/sharp.ts b/packages/integrations/image/src/loaders/sharp.ts index f76a16d39..e1d60e97f 100644 --- a/packages/integrations/image/src/loaders/sharp.ts +++ b/packages/integrations/image/src/loaders/sharp.ts @@ -1,6 +1,6 @@ import sharp from 'sharp'; -import type { OutputFormat, SSRImageService, TransformOptions } from './index.js'; import { isAspectRatioString, isOutputFormat } from '../utils/images.js'; +import type { OutputFormat, SSRImageService, TransformOptions } from './index.js'; class SharpService implements SSRImageService { async getImageAttributes(transform: TransformOptions) {