/** * Gets the current locale code from the `"x-lingo-locale"` header. * * @returns Promise that resolves to the current locale code, or `"en"` if no header is found. * * @example Get locale from headers in a server component * ```typescript * import { loadLocaleFromHeaders } from "lingo.dev/react/rsc"; * * export default async function ServerComponent() { * const locale = await loadLocaleFromHeaders(); * return
Current locale: {locale}
; * } * ``` */ export declare function loadLocaleFromHeaders(): Promise; /** * Gets the current locale code from the `"lingo-locale"` cookie. * * @returns Promise that resolves to the current locale code, or `"en"` if no cookie is found. * * @example Get locale from cookies in a server component * ```typescript * import { loadLocaleFromCookies } from "lingo.dev/react/rsc"; * * export default async function ServerComponent() { * const locale = await loadLocaleFromCookies(); * return
User's saved locale: {locale}
; * } * ``` */ export declare function loadLocaleFromCookies(): Promise; /** * Sets the current locale in the `"lingo-locale"` cookie. * * @param locale - The locale code to store in the cookie. * * @example Set locale in a server action * ```typescript * import { setLocaleInCookies } from "lingo.dev/react/rsc"; * * export async function changeLocale(locale: string) { * "use server"; * await setLocaleInCookies(locale); * redirect("/"); * } * ``` */ export declare function setLocaleInCookies(locale: string): Promise; /** * Loads the dictionary for the current locale. * * The current locale is determined by the `"lingo-locale"` cookie. * * @param loader - A callback function that loads the dictionary for the current locale. * * @returns Promise that resolves to the dictionary object containing localized content. * * @example Load dictionary from request in a server component * ```typescript * import { loadDictionaryFromRequest, loadDictionary } from "lingo.dev/react/rsc"; * * export default async function ServerComponent() { * const dictionary = await loadDictionaryFromRequest(loadDictionary); * return
{dictionary.welcome}
; * } * ``` */ export declare function loadDictionaryFromRequest(loader: (locale: string) => Promise): Promise;