astro/packages/astro/client-image.d.ts
Erika acf78c5e27
fix(assets): Fix types to be more accurate (#6530)
* fix(assets): Fix types to be more accurate

* chore: changeset
2023-03-13 13:54:56 +01:00

41 lines
925 B
TypeScript

/// <reference path="./client-base.d.ts" />
// TODO: Merge this file with `client-base.d.ts` in 3.0, when the `astro:assets` feature isn't under a flag anymore.
type InputFormat = import('./dist/assets/types.js').InputFormat;
interface ImageMetadata {
src: string;
width: number;
height: number;
format: InputFormat;
}
declare module '*.gif' {
const metadata: ImageMetadata;
export default metadata;
}
declare module '*.jpeg' {
const metadata: ImageMetadata;
export default metadata;
}
declare module '*.jpg' {
const metadata: ImageMetadata;
export default metadata;
}
declare module '*.png' {
const metadata: ImageMetadata;
export default metadata;
}
declare module '*.tiff' {
const metadata: ImageMetadata;
export default metadata;
}
declare module '*.webp' {
const metadata: ImageMetadata;
export default metadata;
}
declare module '*.svg' {
const metadata: ImageMetadata;
export default metadata;
}