Skip to content

Commit afb0409

Browse files
authored
Merge pull request #631 from EffortlessSteven/chore/annotate-optimizedimage-only
fix(types): annotate optimized image type in adaptOpenGraphImages
2 parents 2381a12 + c6ae31f commit afb0409

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/images.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { isUnpicCompatible, unpicOptimizer, astroAssetsOptimizer } from './images-optimization';
22
import type { ImageMetadata } from 'astro';
33
import type { OpenGraph } from '@astrolib/seo';
4+
import type { ImagesOptimizer } from './images-optimization';
5+
/** The optimized image shape returned by our ImagesOptimizer */
6+
type OptimizedImage = Awaited<ReturnType<ImagesOptimizer>>[0];
47

58
const load = async function () {
69
let images: Record<string, () => Promise<unknown>> | undefined = undefined;
@@ -71,7 +74,7 @@ export const adaptOpenGraphImages = async (
7174
};
7275
}
7376

74-
let _image;
77+
let _image: OptimizedImage | undefined;
7578

7679
if (
7780
typeof resolvedImage === 'string' &&

0 commit comments

Comments
 (0)