export declare const TWINKLY_ERROR_CODES: readonly ["device_not_found", "no_device_specified", "device_unreachable", "device_request_failed", "discovery_failed"]; export type TwinklyErrorCode = (typeof TWINKLY_ERROR_CODES)[number]; export interface TwinklyErrorOptions { /** HTTP status code, when the failure came from a device response. */ status?: number; /** Name of the device involved, for context. */ device?: string; /** Underlying error, preserved for logging/debugging. */ cause?: unknown; } /** A normalized, tool-friendly error. */ export declare class TwinklyError extends Error { readonly name = "TwinklyError"; readonly code: TwinklyErrorCode; readonly status?: number; readonly device?: string; constructor(code: TwinklyErrorCode, message: string, options?: TwinklyErrorOptions); } /** * Normalize any thrown value into a {@link TwinklyError}. * * - {@link TwinklyError} passes through (optionally tagged with `device`). * - {@link FetchError} → `device_request_failed`, carrying the HTTP status. * - Any other `Error` → `device_unreachable` (the request never completed). * - Anything else → `device_request_failed` with a stringified message. */ export declare function toTwinklyError(err: unknown, device?: string): TwinklyError;