import type { DeliveryMenuItem } from './delivery.js'; /** * Turn delivered menu entries into hrefs, applying the site's own term-URL policy. * * The other half of the callback that could not cross the wire. `resolveMenu` takes a `termHref` * function, and a function cannot be serialised — so the delivery API returns term targets * *unresolved* and the consumer supplies exactly the resolver it would have passed, on its own side. * "Taproot has no opinion about term URLs" survives the split that way, where a server-side setting * for which taxonomies get pages would have made the CMS assert something only the site knows. * * In its own module rather than in `delivery.ts` because it has to be reachable from * `@taprootcms/core/pure`: a consumer runs this, and `delivery.ts` imports Kysely. Nothing here does — * the only import is a type, which is erased at build. */ export interface MenuHrefTarget { id: string; name: string; slug: string; taxonomyApiId: string; } export interface MenuLink { id: string; label: string; href: string; openInNewTab: boolean; noFollow: boolean; /** * The composed `rel`, or null. Carried all the way here on purpose. * * This is the shape a consumer's template actually renders from, so dropping `rel` at this last * step would leave every site assembling it from `openInNewTab` again — which is precisely what * both existing consumers did, and both wrote `noopener` without `noreferrer`. */ rel: string | null; children: MenuLink[]; } export declare function applyTermHrefs(items: DeliveryMenuItem[], termHref: (term: MenuHrefTarget) => string | null): MenuLink[];