import type { AeoPageProps } from '../components/index.js'; import type { ExtractionDiagnostics, PageAlternate } from './index.js'; import type { EntityReference, SchemaEntity } from './schema.js'; export type { AeoPageProps }; export interface AeoPageInput { /** Authored Markdown, used instead of extracting from the rendered HTML. */ markdown?: string; /** * A content-collection entry. Its `body` becomes the Markdown and its `data` * supplies the title, description and dates when they are not given directly. * An `.mdx` body is never used as Markdown: a registered `astro-aeo/mdx` * renderer converts it, and otherwise the rendered HTML is extracted. */ source?: unknown; title?: string; description?: string; image?: string; language?: string; /** Documentation version label, such as `v2`. One path segment of letters, digits, `.`, `_` or `-`. */ version?: string; versionGroup?: string; alternates?: PageAlternate[]; published?: Date | string; lastModified?: Date | string; authors?: EntityReference[]; entities?: SchemaEntity[]; directives?: Partial<{ index: boolean; includeInLlms: boolean; includeInLlmsFull: boolean; generateMarkdown: boolean; }>; /** Where the content came from, recorded in diagnostics. */ sourcePath?: string; sourceKind?: PageSource['kind']; } /** * Normalize what a page knows about itself into the props for ``. * * Extraction can only approximate a page from its rendered HTML. Where a page was * built from Markdown, this hands the original to astro-aeo instead. */ export declare function defineAeoPage(input?: AeoPageInput): AeoPageProps; export interface PageSource { kind: 'markdown' | 'mdx' | 'astro' | 'cms' | 'rendered' | 'custom'; path?: string; body?: string; hash?: string; } /** One serializable page a catalog reports. */ export interface PageDescriptor { /** Root-relative path, e.g. `/blog/hello`. */ pathname: string; /** Optional configured origin used with `pathname` as the cross-domain identity. */ origin?: string; /** Normalized Astro locale identity or derived canonical language tag. */ locale?: string; routePattern?: string; rendering?: 'prerendered' | 'on-demand'; title?: string; description?: string; image?: string; language?: string; /** Documentation version label, such as `v2`. Absent for unversioned sites. */ version?: string; versionGroup?: string; alternates?: PageAlternate[]; markdown?: string; dates?: { published?: string; modified?: string }; authors?: EntityReference[]; entities?: SchemaEntity[]; directives?: Partial<{ index: boolean; includeInLlms: boolean; includeInLlmsFull: boolean; generateMarkdown: boolean; }>; /** ISO date. */ lastModified?: string; sourcePath?: string; source?: PageSource; extraction?: ExtractionDiagnostics; } /** @deprecated Use PageDescriptor. */ export type CatalogPage = PageDescriptor; export interface CatalogContext { command: 'dev' | 'build' | 'preview'; siteUrl: string; base: string; trailingSlash: 'always' | 'never' | 'ignore'; } /** * Lists pages that Astro-AEO cannot enumerate from static build output or from a * prerendered development `getStaticPaths()` call. Catalogs remain necessary for * on-demand or SSR, CMS-only, and synthetic routes. A catalog may also overlay a * concrete or automatically discovered path with exact authored source and metadata. * Astro-AEO never crawls to find routes. A module exporting this contract must be * compiled to Node-loadable `.js`, `.mjs`, or `.cjs` before it is configured as a * catalog entrypoint. */ export interface PageCatalog { name?: string; listPages(context: CatalogContext): PageDescriptor[] | Promise; }