/**
* Plan-native locale link rewrite for serve-host and static-emit.
* Href authority is RouteId × LocaleId realization rows — not path parsing on existing href.
*/
export declare const LOCALE_LINK_PLAN_SCHEMA = "vmz.static.locale_link_plan.v0";
export type LinkRouteAlias = {
/** Author Link `to` / `data-vmz-route` (class RouteId, e.g. IndexPage). */
linkRouteId: string;
/** Locale realization `routeId` (often chunk path, e.g. pages/index). */
realizationRouteId: string;
};
export type LocaleHrefArtifact = {
locales?: Array<{
id: string;
} | string>;
defaultLocale?: string;
routing?: {
strategy?: string;
defaultPrefix?: string;
defaultLocale?: string;
};
realizations?: Array<{
routeId: string;
localeId: string;
path: string;
}>;
/**
* Bridge author Link RouteId ↔ realization routeId.
* Realization artifacts historically key by chunk path; Links emit class names.
*/
linkRouteAliases?: LinkRouteAlias[];
};
export type LocaleLinkPlanRow = {
routeId: string;
localeId: string;
href: string;
};
export type LocaleLinkPlan = {
schema: typeof LOCALE_LINK_PLAN_SCHEMA;
rows: LocaleLinkPlanRow[];
};
/** Build Link RouteId aliases from deployment page units (`routeId` + `chunkId`). */
export declare function linkRouteAliasesFromUnits(units: Array<{
kind?: string;
routeId?: string;
chunkId?: string;
}> | null | undefined): LinkRouteAlias[];
/** Build RouteId × LocaleId → href rows from locale route realization artifact. */
export declare function buildLocaleLinkPlan(artifact: LocaleHrefArtifact | null | undefined): LocaleLinkPlan;
/** Apply plan rows to `` markers for one LocaleId. */
export declare function applyLocaleLinkPlan(html: string, localeId: string, plan: LocaleLinkPlan, escapeAttr?: (s: string) => string): string;
/** Rewrite `` using a frozen locale link plan (preferred) or build once from realization. */
export declare function localizeBodyLinks(html: string, localeId: string, artifact: LocaleHrefArtifact, escapeAttr?: (s: string) => string, frozenPlan?: LocaleLinkPlan | null): string;
/** Compact RouteId → LocaleId → href table for browser (no path-prefix algebra). */
export declare function localeHrefTableFromPlan(plan: LocaleLinkPlan | null | undefined): Record>;
/** Legacy same-app href helper for callers without `data-vmz-route` markers. */
export declare function localizeSameAppHref(href: string, localeId: string, artifact: LocaleHrefArtifact): string;