type DefaultLangCode = "fr" type SupportedLangCode = "en" type LangCode = DefaultLangCode | SupportedLangCode type RouteUri = | "/articles/[slug]" | "/articles" | "/agments/[slug]" | "/agments" | "/offres/web-classique" | "/references" | "/veille" | "/" | "/plan-du-site" type RouteParams = {"/articles/[slug]": { "slug": string; }; "/articles": undefined; "/agments/[slug]": { "slug": string; }; "/agments": undefined; "/offres/web-classique": undefined; "/references": undefined; "/veille": undefined; "/": undefined; "/plan-du-site": undefined; } type TranslationPath = "accueil" | "tagline" | "copyright" | "contact.title" | "contact.email" | "contact.tel" | "contenuVide" | "header.skipLink" | "header.mainNav" | "header.homeLink" | "sitemap" | "prevNext.contenus" | "prevNext.precedent" | "prevNext.suivant" | "article.titre" | "article.tagline" | "article.published" | "meta.publication" | "meta.modification" | "meta.credit" | "fragments.titre" | "fragments.tagline" | "references.titre" | "references.slug" | "references.cta" | "references.tagline" | "veille.titre" | "veille.tagline" | "erreur.introuvable" | "erreur.autre" | "erreur.lienRetour" | "seo.meta.description" | "seo.article.title" | "seo.article.description" | "seo.code.title" | "seo.code.description" | "seo.references.title" | "seo.references.description" | "index.articles.pageName" | "index.articles.subtitle" | "index.fragments.pageName" | "index.fragments.subtitle" | "index.references.pageName" | "index.references.subtitle" | "index.veille.pageName" | "index.veille.subtitle" | "index.title" | "index.subtitle" | "index.quoi" | "index.comment" | "index.opensource" | "index.writing" | "index.latestProjects" | "index.latestArticles" | "index.allProjects" | "index.allArticles" | "index.latestSnippets" | "index.allSnippets" | "index.toc" | "contact.contenuVide" type TranslationOptions = { "accueil": {} | undefined; "tagline": {} | undefined; "copyright": {} | undefined; "contact.title": {} | undefined; "contact.email": {} | undefined; "contact.tel": {} | undefined; "contenuVide": {} | undefined; "header.skipLink": {} | undefined; "header.mainNav": {} | undefined; "header.homeLink": {} | undefined; "sitemap": {} | undefined; "prevNext.contenus": {} | undefined; "prevNext.precedent": {} | undefined; "prevNext.suivant": {} | undefined; "article.titre": {} | undefined; "article.tagline": {} | undefined; "article.published": { datetime: unknown; options: unknown; }; "meta.publication": {} | undefined; "meta.modification": {} | undefined; "meta.credit": {} | undefined; "fragments.titre": {} | undefined; "fragments.tagline": {} | undefined; "references.titre": {} | undefined; "references.slug": {} | undefined; "references.cta": {} | undefined; "references.tagline": {} | undefined; "veille.titre": {} | undefined; "veille.tagline": {} | undefined; "erreur.introuvable": {} | undefined; "erreur.autre": {} | undefined; "erreur.lienRetour": {} | undefined; "seo.meta.description": {} | undefined; "seo.article.title": {} | undefined; "seo.article.description": {} | undefined; "seo.code.title": {} | undefined; "seo.code.description": {} | undefined; "seo.references.title": {} | undefined; "seo.references.description": {} | undefined; "index.articles.pageName": {} | undefined; "index.articles.subtitle": {} | undefined; "index.fragments.pageName": {} | undefined; "index.fragments.subtitle": {} | undefined; "index.references.pageName": {} | undefined; "index.references.subtitle": {} | undefined; "index.veille.pageName": {} | undefined; "index.veille.subtitle": {} | undefined; "index.title": {} | undefined; "index.subtitle": {} | undefined; "index.quoi": {} | undefined; "index.comment": {} | undefined; "index.opensource": {} | undefined; "index.writing": {} | undefined; "index.latestProjects": {} | undefined; "index.latestArticles": {} | undefined; "index.allProjects": {} | undefined; "index.allArticles": {} | undefined; "index.latestSnippets": {} | undefined; "index.allSnippets": {} | undefined; "index.toc": {} | undefined; "contact.contenuVide": {} | undefined; } declare module "astro-i18n" { export * from "astro-i18n/" export function l( route: Uri | string & {}, ...args: Uri extends keyof RouteParams ? undefined extends RouteParams[Uri] ? [params?: Record, targetLangCode?: LangCode, routeLangCode?: LangCode] : [params: RouteParams[Uri], targetLangCode?: LangCode, routeLangCode?: LangCode] : [params?: Record, targetLangCode?: LangCode, routeLangCode?: LangCode] ): string export function t( path: Path | string & {}, ...args: undefined extends TranslationOptions[Path] ? [options?: keyof TranslationOptions extends Path ? Record : TranslationOptions[Path], langCode?: LangCode] : [options: TranslationOptions[Path], langCode?: LangCode] ): string export function extractRouteLangCode(route: string): LangCode | undefined type Translation = string | { [translationKey: string]: string | Translation } type Translations = { [langCode: string]: Record } type RouteTranslations = { [langCode: string]: Record } type InterpolationFormatter = (value: unknown, ...args: unknown[]) => string class AstroI18n { defaultLangCode: DefaultLangCode supportedLangCodes: SupportedLangCode[] showDefaultLangCode: boolean translations: Translations routeTranslations: RouteTranslations get langCodes(): LangCode[] get langCode(): LangCode set langCode(langCode: LangCode) get formatters(): Record init(Astro: { url: URL }, formatters?: Record): void addTranslations(translations: Translations): void addRouteTranslations(routeTranslations: RouteTranslations): void getFormatter(name: string): InterpolationFormatter | undefined setFormatter(name: string, formatter: InterpolationFormatter): void deleteFormatter(name: string): void } export const astroI18n: AstroI18n }