11import type { H3Event } from 'h3'
2- import type { OgImageComponent , OgImageOptions , OgImageRuntimeConfig } from '../types'
2+ import type { OgImageComponent , OgImageOptions , OgImageOptionsInternal , OgImageRuntimeConfig } from '../types'
33import { componentNames } from '#og-image-virtual/component-names.mjs'
44import { useRuntimeConfig } from 'nitropack/runtime'
55import { joinURL } from 'ufo'
@@ -10,15 +10,15 @@ export interface GetOgImagePathResult {
1010 hash ?: string
1111}
1212
13- export function getOgImagePath ( _pagePath : string , _options ?: Partial < OgImageOptions > ) : GetOgImagePathResult {
13+ export function getOgImagePath ( _pagePath : string , _options ?: Partial < OgImageOptionsInternal > ) : GetOgImagePathResult {
1414 const baseURL = useRuntimeConfig ( ) . app . baseURL
1515 const { defaults } = useOgImageRuntimeConfig ( )
1616 const extension = _options ?. extension || defaults . extension
1717 const isStatic = import . meta. prerender
1818 const options : Record < string , any > = { ..._options , _path : _pagePath }
1919 // Include the component template hash so that template changes produce different URLs,
2020 // busting CDN/build caches (Vercel, social platform crawlers like Twitter/Facebook, etc.)
21- const componentName = _options ?. component || defaults . component || ( componentNames as OgImageComponent [ ] ) ?. [ 0 ] ?. pascalName
21+ const componentName = _options ?. component || ( componentNames as OgImageComponent [ ] ) ?. [ 0 ] ?. pascalName
2222 const component = ( componentNames as OgImageComponent [ ] ) ?. find ( c => c . pascalName === componentName || c . kebabName === componentName )
2323 if ( component ?. hash )
2424 options . _componentHash = component . hash
0 commit comments