Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
MoustaphaDev committed Jan 12, 2023
1 parent 0b1f0f3 commit 8bdf53d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/integrations/image/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/// <reference types="astro/astro-jsx" />
export { default as Image } from './Image.astro';
export { default as Picture } from './Picture.astro';
import type { HTMLAttributes as AllHTMLAttributes } from 'astro/types';
import type { HTMLAttributes } from 'astro/types';

import type { TransformOptions, OutputFormat } from '../dist/loaders/index.js';
import type { ImageMetadata } from '../dist/vite-plugin-astro-image.js';
import { AstroBuiltinAttributes } from 'astro';

export interface ImageComponentLocalImageProps
extends Omit<TransformOptions, 'src'>,
Expand All @@ -24,7 +25,7 @@ export interface ImageComponentRemoteImageProps extends TransformOptions, ImgHTM
}

export interface PictureComponentLocalImageProps
extends Omit<HTMLAttributes, 'src' | 'width' | 'height'>,
extends GlobalHTMLAttributes,
Omit<TransformOptions, 'src'>,
Pick<ImgHTMLAttributes, 'loading' | 'decoding'> {
src: ImageMetadata | Promise<{ default: ImageMetadata }>;
Expand All @@ -36,7 +37,7 @@ export interface PictureComponentLocalImageProps
}

export interface PictureComponentRemoteImageProps
extends Omit<HTMLAttributes, 'src' | 'width' | 'height'>,
extends GlobalHTMLAttributes,
TransformOptions,
Pick<ImgHTMLAttributes, 'loading' | 'decoding'> {
src: string;
Expand All @@ -49,9 +50,12 @@ export interface PictureComponentRemoteImageProps
background: TransformOptions['background'];
}

export type ImgHTMLAttributes = AllHTMLAttributes<'img'>;
export type ImgHTMLAttributes = HTMLAttributes<'img'>;

export type HTMLAttributes = Omit<astroHTML.JSX.HTMLAttributes, 'set:text' | 'set:html' | 'is:raw'>;
export type GlobalHTMLAttributes = Omit<
astroHTML.JSX.HTMLAttributes,
keyof Omit<AstroBuiltinAttributes, 'class:list'>
>;

let altWarningShown = false;

Expand Down

0 comments on commit 8bdf53d

Please sign in to comment.