import type { ComputedRef, MaybeRefOrGetter } from 'vue'; import type { EponymeSeoDefinition } from '../fields/seo.js'; import type { EponymeImageValue } from '../types/field.js'; import { type EponymeSeoHead, type EponymeSeoHeadOptions } from '../utils/eponyme-seo-head.js'; export interface UseEponymeSeoOptions { /** Key of the `field.seo()` in the entry. @default 'seo' */ field?: string; /** Fallback title. Defaults to the entry's `title` when it has a text one. */ title?: MaybeRefOrGetter; description?: MaybeRefOrGetter; /** Fallback sharing image: a `field.image()` value, whose alternative is shared too, or a URL. */ image?: MaybeRefOrGetter; /** `%s · My site`, or a function of the title. */ titleTemplate?: EponymeSeoHeadOptions['titleTemplate']; siteName?: string; /** Defaults to `eponyme.siteUrl`, then `runtimeConfig.public.siteUrl`, then the request's origin. */ siteUrl?: string; /** `false` emits no canonical link unless the entry names one. @default true */ canonical?: boolean; definition?: Pick; } /** * Sets the page's title, description, sharing tags, robots directive and canonical link from an entry's * `field.seo()`, falling back to the entry itself for what the author left empty. * * @example * ```ts * const { data } = useEponymeCollectionEntry('articles', slug) * useEponymeSeo(() => data.value?.data, { * description: () => data.value?.data.excerpt, * image: () => data.value?.data.cover, * titleTemplate: '%s · My site', * }) * ``` */ export declare function useEponymeSeo(entry: MaybeRefOrGetter | null | undefined>, options?: UseEponymeSeoOptions): ComputedRef;