/** * Error codes mirroring tachyon_error_code_str() in tachyon_node.cpp. */ export declare const ErrorCode: { readonly NullPtr: "ERR_TACHYON_NULL_PTR"; readonly Mem: "ERR_TACHYON_MEM"; readonly Open: "ERR_TACHYON_OPEN"; readonly Truncate: "ERR_TACHYON_TRUNCATE"; readonly Chmod: "ERR_TACHYON_CHMOD"; readonly Seal: "ERR_TACHYON_SEAL"; readonly Map: "ERR_TACHYON_MAP"; readonly InvalidSz: "ERR_TACHYON_INVALID_SZ"; readonly Full: "ERR_TACHYON_FULL"; readonly Empty: "ERR_TACHYON_EMPTY"; readonly Network: "ERR_TACHYON_NETWORK"; readonly System: "ERR_TACHYON_SYSTEM"; readonly Interrupted: "ERR_TACHYON_INTERRUPTED"; readonly AbiMismatch: "ERR_TACHYON_ABI_MISMATCH"; readonly Unknown: "ERR_TACHYON_UNKNOWN"; }; export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode]; /** * Base class for all errors crossing the N-API boundary. */ export declare class TachyonError extends Error { /** Native C-API error code, set as a `.code` property by N-API. */ readonly code: ErrorCode; constructor(message: string, code: ErrorCode); } /** * Thrown when the TachyonHandshake fails. * Connection is rejected before the first SCM_RIGHTS exchange if the producer * and consumer were compiled with differing Tachyon versions or TACHYON_MSG_ALIGNMENT values. */ export declare class AbiMismatchError extends TachyonError { constructor(); } /** * Thrown when the bus transitions to TACHYON_STATE_FATAL_ERROR. * * Triggered exclusively by a corrupted message header detected in acquire_rx, * not by a producer crash. A crashed producer causes the consumer to block * indefinitely; use an external supervisor if dead-peer detection is required. * * This error is raised by Bus after polling tachyon_get_state(), not * thrown directly by the native binding there is no corresponding tachyon_error_t. */ export declare class PeerDeadError extends TachyonError { constructor(); } /** * Returns true for any error originating from the Tachyon C++ binding. */ export declare function isTachyonError(err: unknown): err is TachyonError; /** * Returns true if the error is an ABI contract violation detected during handshake. */ export declare function isAbiMismatch(err: unknown): err is AbiMismatchError; /** * Returns true if the bus has entered a fatal error state. * Uses instanceof rather than .code. PeerDeadError is raised by Bus, not the native binding. */ export declare function isPeerDead(err: unknown): err is PeerDeadError; /** * Returns true if the SPSC ring buffer is full. Expected on the TX hot path when the producer outpaces the consumer. */ export declare function isFull(err: unknown): err is TachyonError; //# sourceMappingURL=error.d.ts.map