import type { AuthLocale } from '../../i18n/keys.js'; /** * Resolve a server error to a localized message. Pass the `code` and `error` * fields from a handler's JSON error body plus the active `AuthLocale`: * * ```ts * error = errorMessageFromCode(data.code, t, data.error); * ``` * * Resolution order: * 1. a known `code` with a localized string → the translation; * 2. otherwise the raw server `error` prose (back-compat with non-i18n * consumers and any code not yet translated); * 3. otherwise `undefined`, so the caller can apply its own generic fallback. * * `validation_error` deliberately resolves to the server prose when one is * supplied (the field-level "email is invalid" message is more useful than a * generic localized string); only a code-less/prose-less validation error uses * the generic localized text. */ export declare function errorMessageFromCode(code: string | undefined, t: AuthLocale, fallbackError?: string): string | undefined;