import { type ReactNode } from 'react'; import { type V2Format } from '../utils/format.util'; import { type FreshnessRegistry } from '../utils/freshness.util'; import { type LabelColorRegistry } from '../utils/labelColors.util'; import type { SettledRequest } from '../types/request.type'; import { type RequestStore } from '../utils/requestStore.util'; export type V2PageValue = { locale: string; timeZone: string; /** Formats a value with the country of the page. */ format: (value: unknown, format: V2Format) => string; }; export interface V2RequestScopeProviderProps { /** `null` cuts an inherited scope: the page gets a store of its own. */ store: RequestStore | null; children: ReactNode; } export declare const V2RequestScopeProvider: ({ store, children, }: V2RequestScopeProviderProps) => import("react/jsx-runtime").JSX.Element; /** The `responseKey` of the piece being rendered; set by `V2Block`. */ export declare const V2PieceKeyContext: import("react").Context; export interface V2PageProviderProps { /** BCP 47 locale of the institution's country, from the page wire. */ locale: string; /** IANA time zone of the institution, from the page wire. */ timeZone: string; children: ReactNode; } /** * Gives every V2 piece under it the country of the page. An unknown locale or * zone falls back to the suite defaults (`es-MX`, `America/Mexico_City`) and * warns in development; it never throws. */ export declare const V2PageProvider: ({ locale, timeZone, children, }: V2PageProviderProps) => import("react/jsx-runtime").JSX.Element; /** Country of the page and its formatter; the defaults outside a provider. */ export declare const useV2Page: () => V2PageValue; /** * The page's label color registry. Outside a provider each call site owns its * registry, so a piece alone still follows the rules inside itself. */ export declare const useLabelColors: () => LabelColorRegistry; /** * The page's request store: pieces of one page with the same request share it. * Outside a provider each call site owns a private store, so a piece alone * still works and nothing is shared. */ export declare const useRequestStore: () => RequestStore; /** The page's freshness registry; `null` outside a provider (nothing reports). */ export declare const useFreshnessRegistry: () => FreshnessRegistry | null; /** The `responseKey` of the enclosing V2 piece; `undefined` outside `V2Block`. */ export declare const useV2PieceKey: () => string | undefined; /** Props for the root element of a V2 component: identification only. */ export type V2RootProps = { 'data-response-key'?: string; }; /** * Spread this on the root element of every V2 component. It reads only * `V2PieceKeyContext`: a non-empty `responseKey` becomes `data-response-key`, * anything else (no key, empty key, outside `V2Block`) yields no attribute. */ export declare const useV2RootProps: () => V2RootProps;