import { Charger } from "./Charger"; import { Pixel } from "./Pixel"; import { PixelConnect } from "./PixelConnect"; type PixelType = PixelConnect | Pixel | Charger; /** * Base class for errors thrown by the {@link PixelConnect} or its descendant classes. * @category Pixels */ export declare class PixelError extends Error { /** The Pixel instance for which the error occurred. */ readonly pixel: PixelType; /** The error description. */ readonly description: string; /** The original error that caused this error to be thrown. */ readonly cause?: Error; constructor(pixel: PixelType, message: string, cause?: Error); } /** * Base class for errors thrown by the {@link Pixel.connect} instance method. * @category Pixels */ export declare class PixelConnectError extends PixelError { constructor(pixel: PixelType, msgOrError: string | Error | unknown); } /** * Thrown by {@link Pixel.connect} on connection timeout. * @category Pixels */ export declare class PixelConnectTimeoutError extends PixelConnectError { constructor(pixel: PixelType, timeoutMs: number); } /** * Thrown by {@link Pixel.connect} on connection error caused by a cancellation * (such as a call to {@link Pixel.disconnect} during the connection sequence). * @category Pixels */ export declare class PixelConnectCancelledError extends PixelConnectError { constructor(pixel: PixelType); } /** * Thrown by {@link Pixel.connect} on connection error caused by a Pixel id * mismatch between the one given to the instance's constructor and the one * received during identification. * @category Pixels */ export declare class PixelConnectIdMismatchError extends PixelConnectError { constructor(pixel: PixelType, pixelId: number); } /** * Thrown by methods of the {@link Pixel} class on errors caused by a timeout * while waiting for a message from the die. * @category Pixels */ export declare class PixelWaitForMessageTimeoutError extends PixelError { constructor(pixel: PixelType, timeoutMs: number, messageType: string); } /** * Thrown by methods of the {@link Pixel} class on errors caused by a disconnection * while waiting for a message from the die. * @category Pixels */ export declare class PixelWaitForMessageDisconnectError extends PixelError { constructor(pixel: PixelType, messageType: string); } /** * Thrown by methods of the {@link Pixel} class when trying to send a message which * is incompatible with the current firmware running on the die. * @category Pixels */ export declare class PixelIncompatibleMessageError extends PixelError { constructor(pixel: PixelType, name: string, libApiVersion: number, fwApiVersion: number, compat: "library" | "firmware"); } /** * Thrown by {@link PixelConnect.rename} method when an empty name is passed. * @category Pixels */ export declare class PixelEmptyNameError extends PixelError { constructor(pixel: PixelType); } /** * Base class for errors thrown by {@link Pixel} data transfer instance methods. * @category Pixels */ export declare class PixelTransferError extends PixelError { constructor(pixel: PixelType, message: string, cause?: Error); } /** * Thrown by {@link Pixel} data transfer instance methods. * @category Pixels */ export declare class PixelTransferInProgressError extends PixelTransferError { constructor(pixel: PixelType); } /** * Thrown by {@link Pixel} data transfer instance methods. * @category Pixels */ export declare class PixelTransferInvalidDataError extends PixelTransferError { constructor(pixel: PixelType); } /** * Thrown by {@link Pixel} data transfer instance methods. * @category Pixels */ export declare class PixelTransferCompletedTimeoutError extends PixelTransferError { constructor(pixel: PixelType, ackType: string); } /** * Thrown by {@link Pixel} data transfer instance methods. * @category Pixels */ export declare class PixelTransferOutOfMemoryError extends PixelTransferError { constructor(pixel: PixelType, dataSize: number); } export {}; //# sourceMappingURL=errors.d.ts.map