/** * Standard error codes for the DEM library. */ export declare enum DEMErrorCode { DB_NOT_CONNECTED = "DEM_ERR_DB_NOT_CONNECTED", DB_OPERATION_FAILED = "DEM_ERR_DB_OPERATION_FAILED", DB_SAVE_FAILED = "DEM_ERR_DB_SAVE_FAILED", DB_DELETE_FAILED = "DEM_ERR_DB_DELETE_FAILED", MANAGERS_NOT_INITIALIZED = "DEM_ERR_MANAGERS_NOT_INITIALIZED", PRELOAD_FAILED = "DEM_ERR_PRELOAD_FAILED", LOAD_REFERENCES_FAILED = "DEM_ERR_LOAD_REFERENCES_FAILED", OBJECT_LOAD_FAILED = "DEM_ERR_OBJECT_LOAD_FAILED", STARTUP_FAILED = "DEM_ERR_STARTUP_FAILED", VERSION_MISMATCH = "DEM_ERR_VERSION_MISMATCH", MISSING_ARGUMENT = "DEM_ERR_MISSING_ARGUMENT", MISSING_ID = "DEM_ERR_MISSING_ID", INVALID_ARGUMENT = "DEM_ERR_INVALID_ARGUMENT", INVALID_CONSTRUCTOR = "DEM_ERR_INVALID_CONSTRUCTOR", INVALID_MODEL = "DEM_ERR_INVALID_MODEL", INVALID_EVENT = "DEM_ERR_INVALID_EVENT", UNKNOWN_EVENT = "DEM_ERR_UNKNOWN_EVENT", UNDEFINED_EVENT = "DEM_ERR_UNDEFINED_EVENT", PROPERTY_NOT_FOUND = "DEM_ERR_PROPERTY_NOT_FOUND", CANNOT_SET_REF_DIRECTLY = "DEM_ERR_CANNOT_SET_REF_DIRECTLY", OBJECT_NOT_FOUND = "DEM_ERR_OBJECT_NOT_FOUND", DOCUMENT_NOT_FOUND = "DEM_ERR_DOCUMENT_NOT_FOUND", OBJECT_CREATE_FAILED = "DEM_ERR_OBJECT_CREATE_FAILED", OBJECT_DELETE_FAILED = "DEM_ERR_OBJECT_DELETE_FAILED", OBJECT_GET_FAILED = "DEM_ERR_OBJECT_GET_FAILED", REFERENCE_RESOLUTION_FAILED = "DEM_ERR_REFERENCE_RESOLUTION_FAILED", PRELOAD_TIMEOUT = "DEM_ERR_PRELOAD_TIMEOUT", ACCESS_DENIED = "DEM_ERR_ACCESS_DENIED", UNAUTHORIZED = "DEM_ERR_UNAUTHORIZED", SOCKET_NOT_CONNECTED = "DEM_ERR_SOCKET_NOT_CONNECTED", SOCKET_FAILURE = "DEM_ERR_SOCKET_FAILURE", TIMEOUT = "DEM_ERR_TIMEOUT", STORAGE_NOT_SUPPORTED = "DEM_ERR_STORAGE_NOT_SUPPORTED", STORAGE_OPERATION_FAILED = "DEM_ERR_STORAGE_OPERATION_FAILED", DELTA_SYNC_FAILED = "DEM_ERR_DELTA_SYNC_FAILED", ARRAY_MUTATION_FAILED = "DEM_ERR_ARRAY_MUTATION_FAILED", CONCURRENT_MODIFICATION = "DEM_ERR_CONCURRENT_MODIFICATION", INDEX_OUT_OF_BOUNDS = "DEM_ERR_INDEX_OUT_OF_BOUNDS", INTERNAL_ERROR = "DEM_ERR_INTERNAL_ERROR" } /** * Standard descriptions for DEM error codes. */ export declare const DEM_ERROR_DESCRIPTIONS: Record; /** * Returns the human-readable description for a given error code. * * @param code - The DEM error code enum value. * @returns Standard descriptive message corresponding to the error code. */ export declare function getDEMErrorDescription(code: DEMErrorCode): string; /** * Standard typed Error class for DEM. * Enforces structured error codes and optional diagnostic payloads. */ export declare class DEMError extends Error { readonly code: DEMErrorCode; readonly details?: unknown; readonly timestamp: number; /** * Constructs a new DEMError instance. * * @param code - The typed error code. * @param message - Descriptive error message. * @param details - Optional arbitrary diagnostic data. */ constructor(code: DEMErrorCode, message: string, details?: unknown); /** * Serializes the error instance to a JSON-compatible object. * * @returns Plain object representation of the DEMError. */ toJSON(): { name: string; code: DEMErrorCode; message: string; details: unknown; timestamp: number; }; } /** * Converts an unknown caught error or object into a typed DEMError instance. * * @param err - The caught error or value. * @param defaultCode - Fallback error code when the source is not a DEMError. * @returns Standard DEMError instance. */ export declare function toDEMError(err: unknown, defaultCode?: DEMErrorCode): DEMError;