import { type ReactNode } from "react"; import type { PageLocalization, SiteLocales } from "@pantheon-systems/css-client"; import type { LocaleVariant } from "@pantheon-systems/css-client/localization"; /** * A localized page as the render pipeline describes it to the app. Plain JSON, * so it crosses from server to client components. */ export type PublishedPageLocalization = { /** The page's locale, or `null` when it has none set. */ locale: string | null; /** The path of the page. */ path: string; siteLocales: SiteLocales; localization: PageLocalization; /** * The page itself and its other locale variants: those in the site's locales * first, in the site's order, then those with `locale: null`. */ variants: LocaleVariant[]; }; /** What `useP1Localization` returns. */ export type P1Localization = { /** The page's locale, or `null` outside a localized page. */ locale: string | null; /** The site's locales, or `null` outside a localized page. */ siteLocales: SiteLocales | null; /** Every locale variant of the page, for a language switcher. Empty outside a localized page. */ variants: LocaleVariant[]; }; /** * Makes a localized page's details available to `useP1Localization` below it. * `createPublishedPage` renders it around the app's client for every page on a * site with locales. */ export declare function P1LocalizationProvider({ value, children, }: { value: P1Localization; children?: ReactNode; }): import("react").JSX.Element; /** The current page's locale and its locale variants. */ export declare function useP1Localization(): P1Localization;