import { type PkgManager } from './pkgManager.js'; export type FirmwareCompatStatus = 'match' | 'update_available' | 'incompatible'; export type FirmwareCompatDirection = 'device_older' | 'device_newer'; export interface FirmwareCompatResult { status: FirmwareCompatStatus; /** Only set when status === 'update_available'. */ direction: FirmwareCompatDirection | null; deviceVersion: string | null; cliVersion: string; requiredRange: string; } /** * Check whether the firmware version reported by the device is semver- * compatible with this CLI's version. mikrojs and @mikrojs/firmware are * versioned in lockstep, so the CLI's own version is the source of truth. * `cliVersion` is injectable for tests; production callers omit it. * * Returns one of: * - 'match' — device version equals CLI version * - 'update_available' — device satisfies the breakage range but is older or newer * - 'incompatible' — device is outside the range, or didn't report a version */ export declare function checkFirmwareCompat(deviceVersion: string | null, cliVersion?: string): FirmwareCompatResult; /** Format the soft "update available" notice (status === 'update_available'). */ export declare function formatAdvisory(result: FirmwareCompatResult, pm: PkgManager): string; /** * Thrown when the device firmware version is incompatible with this CLI. * Lets callers tell this apart from a generic transport/timeout failure * (the message is self-explanatory and shouldn't be paired with generic * troubleshooting hints). */ export declare class FirmwareIncompatibleError extends Error { name: string; } /** Format the hard incompatibility error (status === 'incompatible'). */ export declare function formatIncompatibleError(result: FirmwareCompatResult, pm: PkgManager): string; /** * Format the warning shown when a read-only diagnostic command proceeds * against incompatible firmware (best-effort mode). Unlike the hard error, * this points the user at matching the CLI to the device — the device may be * a deployed unit you can't reflash, and the goal is to read its state. When * the device reported a concrete version we suggest installing that exact CLI; * otherwise (no version reported) the firmware predates version reporting, so * only reflashing can help. */ export declare function formatBestEffortWarning(result: FirmwareCompatResult, pm: PkgManager): string; //# sourceMappingURL=firmwareCompat.d.ts.map