import type { ErrorMapping } from "./hardware-error-mappings.mjs"; import { ErrorCode } from "./hardware-errors-enums.mjs"; /** * Full DMK (Device Management Kit) `_tag`-based error mappings. * * DMK is Ledger's newer SDK. Unlike legacy `@ledgerhq/errors`, which identify * errors via the standard `error.name` property, DMK errors carry a * non-standard `_tag` string (e.g. `'DeviceSessionNotFound'`, * `'DeviceLockedError'`). Tag values are looked up in this mapping to resolve * the full {@link ErrorMapping} (code, message, severity, category, * userMessage). * * This is the single source of truth for DMK tag → error details. The * code-only {@link DMK_ERROR_TAG_MAPPINGS} is derived from this object so * consumers that only need the `ErrorCode` (e.g. MetaMask Mobile) can use the * simpler mapping without duplicating data. * * These mappings are shared with legacy error names in consumers (e.g. * MetaMask Mobile) since both map to the same `ErrorCode` values. */ export declare const DMK_ERROR_MAPPINGS: Record; /** * DMK `_tag`-to-`ErrorCode` mappings. * * Derived from {@link DMK_ERROR_MAPPINGS} so there is a single source of truth * for tag → code resolution. Consumers that only need the numeric `ErrorCode` * (e.g. MetaMask Mobile) can use this lightweight mapping directly. */ export declare const DMK_ERROR_TAG_MAPPINGS: Record; /** * DMK-specific message patterns for error parsing. * * Each entry maps one or more case-insensitive message substrings to an * `ErrorCode`. Used as a fallback when neither `error.name` nor `_tag` is * recognised, but the error message contains DMK-specific phrasing. */ export declare const DMK_MESSAGE_PATTERNS: readonly { patterns: string[]; code: ErrorCode; }[]; /** * Result of resolving a DMK error from its `_tag` property. */ export type DMKTagResolution = { code: ErrorCode; tag: string; }; /** * Parse a DMK (Device Management Kit) error by its `_tag` property. * * DMK errors carry a non-standard `_tag` string. This function extracts the * tag and looks it up in {@link DMK_ERROR_TAG_MAPPINGS} to resolve the * corresponding `ErrorCode`. * * @param error - The error object to parse. * @returns The resolved `ErrorCode` and the original tag string, or `null` * if no `_tag` is present or the tag is not recognised. */ export declare function getDmkErrorFromTag(error: unknown): DMKTagResolution | null; //# sourceMappingURL=dmk-error-mappings.d.mts.map