import { toUrlLocale, type SiteConfig, type SiteDefaults } from "@aotter/mantle-spec"; /** * Locale + SiteConfig helpers used at request entry by every public * router. Pure functions on existing spec types — no I/O, no env. * * - `siteConfigFromDefaults` materializes a runtime `SiteConfig` * from a consumer's `SiteDefaults` (the author-time declaration). * Fills `canonicalLocale` from `locales[0]`, defaults missing * fields to empty string. Adapters that don't go through the * DB-backed `SiteConfigRepository` use this. * * - `inferLocaleFromPath` reads the first URL path segment, matches * it case-insensitively against `site.locales`, and returns the * canonical locale (preserving the casing in `site.locales`) on * hit. On miss, returns `site.canonicalLocale` (or `"en"` if the * site has no locales configured — should never happen for a * localized site). * * - `isKnownLocale` answers "is this URL segment a valid locale for * this site?" for adapters that need to 404 vs render-locale-home. */ export declare function siteConfigFromDefaults(defaults: SiteDefaults): SiteConfig; export declare function inferLocaleFromPath(path: string, site: SiteConfig): string; export declare function isKnownLocale(locale: string, site: SiteConfig): boolean; /** Canonical → URL form mirror of spec's `toUrlLocale`, re-exported * here so adapters can import locale helpers from one runtime path * without reaching into spec's domain. */ export { toUrlLocale }; //# sourceMappingURL=LocaleNegotiator.d.ts.map