Skip to content

Commit 9ae9b96

Browse files
committed
chore: types
1 parent ea369bc commit 9ae9b96

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/runtime/app/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export interface GetOgImagePathResult {
168168
/**
169169
* @deprecated Use the return value of `defineOgImage()` instead, which now returns an array of generated paths.
170170
*/
171-
export function getOgImagePath(_pagePath: string, _options?: Partial<OgImageOptions>): GetOgImagePathResult {
171+
export function getOgImagePath(_pagePath: string, _options?: Partial<OgImageOptionsInternal>): GetOgImagePathResult {
172172
const runtimeConfig = useRuntimeConfig()
173173
const baseURL = runtimeConfig.app.baseURL
174174
const { defaults } = useOgImageRuntimeConfig()
@@ -177,7 +177,7 @@ export function getOgImagePath(_pagePath: string, _options?: Partial<OgImageOpti
177177
const options: Record<string, any> = { ..._options, _path: _pagePath }
178178
// Include the component template hash so that template changes produce different URLs,
179179
// busting CDN/build caches (Vercel, social platform crawlers like Twitter/Facebook, etc.)
180-
const componentName = _options?.component || defaults?.component || componentNames?.[0]?.pascalName
180+
const componentName = _options?.component || componentNames?.[0]?.pascalName
181181
const component = componentNames?.find((c: any) => c.pascalName === componentName || c.kebabName === componentName)
182182
if (component?.hash)
183183
options._componentHash = component.hash

src/runtime/server/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { H3Event } from 'h3'
2-
import type { OgImageComponent, OgImageOptions, OgImageRuntimeConfig } from '../types'
2+
import type { OgImageComponent, OgImageOptions, OgImageOptionsInternal, OgImageRuntimeConfig } from '../types'
33
import { componentNames } from '#og-image-virtual/component-names.mjs'
44
import { useRuntimeConfig } from 'nitropack/runtime'
55
import { 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

Comments
 (0)