From 095083ed6cb17ecd8f93762781228029477672fc Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Sat, 25 May 2024 04:25:22 +0200 Subject: [PATCH] fix: no need for type --- packages/astro/client.d.ts | 20 +++++++++----------- packages/astro/src/assets/types.ts | 4 ++-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/astro/client.d.ts b/packages/astro/client.d.ts index 3083247cfc..468731dfaa 100644 --- a/packages/astro/client.d.ts +++ b/packages/astro/client.d.ts @@ -72,38 +72,36 @@ declare module 'astro:assets' { export const { getImage, getConfiguredImageService, imageConfig, Image, Picture }: AstroAssets; } -type ImageMetadata = import('./dist/assets/types.js').ImageMetadata; - declare module '*.gif' { - const metadata: ImageMetadata; + const metadata: import('./dist/assets/types.js').ImageMetadata; export default metadata; } declare module '*.jpeg' { - const metadata: ImageMetadata; + const metadata: import('./dist/assets/types.js').ImageMetadata; export default metadata; } declare module '*.jpg' { - const metadata: ImageMetadata; + const metadata: import('./dist/assets/types.js').ImageMetadata; export default metadata; } declare module '*.png' { - const metadata: ImageMetadata; + const metadata: import('./dist/assets/types.js').ImageMetadata; export default metadata; } declare module '*.tiff' { - const metadata: ImageMetadata; + const metadata: import('./dist/assets/types.js').ImageMetadata; export default metadata; } declare module '*.webp' { - const metadata: ImageMetadata; + const metadata: import('./dist/assets/types.js').ImageMetadata; export default metadata; } declare module '*.svg' { - const metadata: ImageMetadata; + const metadata: import('./dist/assets/types.js').ImageMetadata; export default metadata; } declare module '*.avif' { - const metadata: ImageMetadata; + const metadata: import('./dist/assets/types.js').ImageMetadata; export default metadata; } @@ -145,7 +143,7 @@ declare module 'astro:transitions/client' { } declare module 'astro:prefetch' { - export { prefetch, PrefetchOptions } from 'astro/virtual-modules/prefetch.js'; + export { PrefetchOptions, prefetch } from 'astro/virtual-modules/prefetch.js'; } declare module 'astro:i18n' { diff --git a/packages/astro/src/assets/types.ts b/packages/astro/src/assets/types.ts index 7f74ed2eb5..d1bc1b55a1 100644 --- a/packages/astro/src/assets/types.ts +++ b/packages/astro/src/assets/types.ts @@ -33,7 +33,7 @@ export const image_metadata = Symbol.for('image_metadata'); /** * Type returned by ESM imports of images */ -export type ImageMetadata = { +export interface ImageMetadata { src: string; width: number; height: number; @@ -42,7 +42,7 @@ export type ImageMetadata = { /** @internal */ fsPath: string; [image_metadata]: true; -}; +} /** * A yet to be completed with an url `SrcSetValue`. Other hooks will only see a resolved value, where the URL of the image has been added.