/**
 * One-stop SEO meta + JSON-LD composer for a CMS document.
 *
 * Integrators call `composePageMeta()` once in their Next.js route — typically
 * inside `generateMetadata()` — and get back everything needed to inject a
 * production-grade meta tag set:
 *
 *   - `metadata` → drop straight into Next.js `generateMetadata()` return
 *   - `jsonLd` → render as `<script type="application/ld+json">` in the page
 *   - `meta`   → flat `{ name: content }` map for non-Next renderers
 *   - `html`   → pre-rendered HTML snippet (canonical + meta + JSON-LD)
 *
 * Reads per-collection SEO defaults (`CollectionSEOConfig`) and per-site SEO
 * defaults (`SiteSEOConfig`) so individual document edits don't have to repeat
 * boilerplate. Documents may override anything via `pageSettings.*` /
 * `data.metaTitle`, etc.
 */
import type { ActuateCMSConfig, CollectionDefinition, SiteSEOConfig } from '../config/types.js';
/**
 * Minimal document shape consumed by the composer. Mirrors what `/resolve`
 * returns so the composer works on both server-side calls (Prisma documents)
 * and client-side calls (API response bodies).
 */
export interface ComposeDocumentInput {
    id: string;
    collection: string;
    slug?: string | null;
    data?: Record<string, unknown> | null;
    publishedAt?: Date | string | null;
    updatedAt?: Date | string | null;
    structuredData?: Record<string, unknown> | null;
    pageSettings?: Record<string, unknown> | null;
}
export interface ComposePageMetaInput {
    /** Resolved document (from /resolve, Prisma findUnique, etc.). */
    doc: ComposeDocumentInput;
    /** Collection definition for the document. Used for url prefix + SEO defaults. */
    collection?: CollectionDefinition | null;
    /** Full Actuate config. Used to pick up `seo.siteUrl`, `seo.siteName`, organization, etc. */
    config?: Pick<ActuateCMSConfig, 'seo' | 'i18n'> | null;
    /**
     * Override the site URL (useful for preview deployments where the runtime
     * host differs from config.siteUrl). Falls back to `config.seo.siteUrl`.
     */
    siteUrl?: string;
    /**
     * Default Schema.org type to use when neither the doc nor the collection
     * config specifies one. Defaults to "WebPage".
     */
    defaultSchemaType?: string;
    /**
     * Runtime environment used by the `noIndexNonProduction` guard. Defaults to
     * `VERCEL_ENV ?? NODE_ENV`. Any value other than `production` forces noindex
     * when `seo.robots.noIndexNonProduction` is set.
     */
    environment?: string;
    /**
     * hreflang alternates for this document's translations, emitted in `<head>`
     * (and `alternates.languages` in the Next metadata). The caller (e.g.
     * `/resolve`) supplies these since they require knowing sibling documents.
     * Include an `x-default` entry where appropriate.
     */
    alternates?: Array<{
        hreflang: string;
        href: string;
    }>;
}
export interface ComposedPageMeta {
    /** Canonical URL for the document. */
    url: string;
    /** Final page title. */
    title: string;
    /** Final meta description. */
    description?: string;
    /** Canonical override (if doc explicitly set one), else the resolved URL. */
    canonical: string;
    /** Computed JSON-LD object. Render as `<script type="application/ld+json">`. */
    jsonLd: Record<string, unknown> | null;
    /** Pre-rendered `<script type="application/ld+json">` tag. */
    jsonLdHtml: string;
    /** Flat meta-tag map for non-Next.js renderers. */
    meta: Record<string, string>;
    /** Pre-rendered `<meta>` HTML lines (canonical link + meta + og + twitter). */
    metaHtml: string;
    /** Object compatible with Next.js `generateMetadata()` return value. */
    metadata: object;
}
declare function detectSchemaType(collectionSlug: string): string;
/**
 * Resolve the canonical public URL for a document. This is the SINGLE source of
 * truth shared by the public meta composer (`composePageMeta`, which renders the
 * `<link rel="canonical">` / `og:url`) and the XML sitemap, so the two can never
 * disagree and send conflicting signals to crawlers.
 *
 * Precedence mirrors the rest of the platform (`pages-service`,
 * `page-editor-service`, `/resolve`):
 *   1. An explicit `data.path` (the full URL path an editor set, e.g. `/` for
 *      the homepage or `/about/story`) always wins.
 *   2. A `home`/`index`/empty slug maps to the site root.
 *   3. Otherwise `<urlPrefix>/<slug>`.
 */
export declare function resolveDocumentUrl(params: {
    siteUrl: string;
    urlPrefix?: string | null;
    slug?: string | null;
    data?: Record<string, unknown> | null;
}): string;
/**
 * Resolve the canonical URL a document will emit — explicit override or auto
 * from {@link resolveDocumentUrl}. Matches the fallback used in
 * `composePageMeta()` so audits and render stay aligned.
 */
export declare function resolveEffectiveCanonicalUrl(params: {
    data?: Record<string, unknown> | null;
    siteUrl?: string;
    urlPrefix?: string | null;
    slug?: string | null;
}): string;
/** Effective SEO fields a document emits at render time (audit + Content SEO). */
export interface EffectiveMeta {
    metaTitle: string | null;
    metaDescription: string | null;
    ogImage: string | null;
    noindex: boolean;
}
export interface ResolveEffectiveMetaParams {
    data?: Record<string, unknown> | null;
    pageSettings?: Record<string, unknown> | null;
    docTitle?: string | null;
    publishedAt?: Date | string | null;
    collection?: CollectionDefinition | null;
    collectionSlug?: string;
    site?: SiteSEOConfig | undefined;
    siteUrl?: string;
    environment?: string;
}
/**
 * Resolve meta title, description, OG image, and noindex the same way
 * `composePageMeta()` does — so audits match what search engines receive.
 */
export declare function resolveEffectiveMeta(params: ResolveEffectiveMetaParams): EffectiveMeta;
/**
 * Resolve the canonical freshness dates for a document so every public surface
 * (JSON-LD, Open Graph, etc.) reports the same recency. `datePublished` prefers
 * the DB `publishedAt` (set on first publish) but falls back to editorial date
 * fields authors set in the body (`publishedAt`/`publishedDate`/`publishDate`/
 * `date`). `dateModified` prefers `updatedAt` and never predates publication.
 */
export declare function resolveContentDates(params: {
    doc: {
        publishedAt?: unknown;
        updatedAt?: unknown;
    };
    data?: Record<string, unknown> | null;
    page?: Record<string, unknown> | null;
}): {
    datePublished?: string;
    dateModified?: string;
};
/**
 * Compose page meta + JSON-LD from a CMS document + collection config.
 * Pure function — safe to call in any runtime (Edge, Node, browser).
 */
export declare function composePageMeta(input: ComposePageMetaInput): ComposedPageMeta;
export { detectSchemaType };
//# sourceMappingURL=page-meta.d.ts.map