everything-dev
Version:
A consolidated product package for building Module Federation apps with oRPC APIs.
18 lines • 1 kB
text/typescript
//#region src/ui/locale.d.ts
type LocaleOptions<Locale extends string = string> = {
locales: readonly Locale[];
defaultLocale: Locale;
cookieName: string;
};
declare function readLocaleCookie(cookie: string, cookieName: string): string | undefined;
declare function matchLocale<const Locale extends string>(candidate: string | null | undefined, locales: readonly Locale[]): Locale | undefined;
declare function readAcceptLanguage(header: string | null): string[];
declare function resolveLocale<const Locale extends string>({ preferredLocale, cookie, browserLocales, locales, defaultLocale, cookieName }: LocaleOptions<Locale> & {
preferredLocale?: string | null;
cookie: string;
browserLocales: readonly string[];
}): Locale;
declare function serializeLocaleCookie(cookieName: string, locale: string, secure: boolean): string;
//#endregion
export { LocaleOptions, matchLocale, readAcceptLanguage, readLocaleCookie, resolveLocale, serializeLocaleCookie };
//# sourceMappingURL=locale.d.mts.map