import { type Locale } from '@urbicon-ui/i18n'; import type { AuthLocale, PartialAuthLocale } from './keys.js'; /** * Context-scoped hook for the full AuthLocale object at the active locale. Call * during component initialisation, then read it inside a `$derived` so it stays * reactive and resolves against the nearest ``: * * ```svelte * const authLocale = useAuthLocale(); * const t = $derived(mergeAuthLocale(authLocale(), tProp)); * ``` * * Replaces the former free `getAuthLocale()`, which read the global locale * singleton and so could not be request-scoped (SSR-unsafe). */ export declare function useAuthLocale(): () => AuthLocale; /** * Resolve the full `AuthLocale` bundle for a locale **without** any Svelte * context — the SSR-/server-safe counterpart to {@link useAuthLocale}. Used by * the server-side email builders to localize the default transactional mails * from `config.email.locale`. Falls back to the English bundle for an unknown * locale or when `locale` is omitted, so callers never have to guard. */ export declare function resolveAuthLocale(locale?: Locale): AuthLocale; /** * Deep-merge consumer locale `overrides` over a complete `base` bundle — THE * single place a `PartialAuthLocale` becomes a full `AuthLocale`. * Every component resolves its `t` prop through this, so overriding one string * (`{ auth: { login: { title: 'Welcome back' } } }`) keeps every other key from * the active built-in bundle instead of blanking whole subtrees. Objects merge * recursively, string leaves replace, `undefined` entries are skipped. Returns * `base` itself when there is nothing to merge. * * Kind-preserving: an entry whose kind mismatches the base (`null`/array/ * primitive where the bundle has a subtree, an object where it has a string) * is skipped, keeping the base value. TypeScript rules those out, but JSON is * the natural carrier for consumer override files and cannot express * `undefined` — a hand-written `null` must not blank a whole subtree the * postcondition promises to be complete. */ export declare function mergeAuthLocale(base: AuthLocale, overrides?: PartialAuthLocale): AuthLocale; export type { AuthLocale, DeepPartial, PartialAuthLocale } from './keys.js';