/** * Error adapter for @plyaz/api package * Re-exports error classes and utilities from @plyaz/errors with API-specific configuration */ import { ApiPackageError as BaseApiPackageError } from '@plyaz/errors'; import type { PackageErrorLike, ErrorEventFactory } from '@plyaz/types/errors'; import type { EndpointsList } from '../endpoints'; import type { ApiClientInstance } from '@plyaz/types/api'; /** * Namespace for API error events */ export declare const API_ERROR_NAMESPACE = "api"; /** * API-specific ApiPackageError with proper types */ export declare class ApiPackageError extends BaseApiPackageError> { } /** * Event factory adapter for API package * Adapts the API's eventManager to work with the generic error event system */ export declare const apiErrorEventFactory: ErrorEventFactory; export { getErrorDefinition, getErrorCodeByStatus, getErrorCategory, generateCorrelationId, } from '@plyaz/errors'; export { SCOPES as ERROR_SCOPES } from '@plyaz/errors'; export { initializeErrorSystem, addMessageCatalog, setErrorLocale, getErrorLocale, isErrorSystemInitialized, } from '@plyaz/errors'; export { API_ERROR_CODES, ERROR_DEFINITIONS, ERROR_CATEGORY } from '@plyaz/types/errors'; export { COMMON_OPERATIONS as OPERATIONS, COMMON_FIELDS as ERROR_FIELDS, COMMON_STORAGE_TYPES as STORAGE_TYPES, } from '@plyaz/types/errors'; export { INTERNAL_STATUS_CODES as PACKAGE_STATUS_CODES } from '@plyaz/types/errors'; import type { ErrorEventHandlers, ErrorEventHandler, EventScope, ScopedErrorEmitterOptions } from '@plyaz/types/errors'; /** * Register error handler (API namespace) */ export declare function registerErrorHandler(eventType: string, handler: ErrorEventHandler, options?: Omit): () => void; /** * Register error handlers (API namespace) */ export declare function registerErrorHandlers(handlers: ErrorEventHandlers, options?: { scope?: EventScope; strategy?: 'merge' | 'replace' | 'prepend' | 'append'; }): void; /** * Set error handlers (API namespace) */ export declare function setErrorHandlers(handlers: ErrorEventHandlers, scope?: EventScope): void; /** * Get error handlers (API namespace) */ export declare function getErrorHandlers(scope?: EventScope): ErrorEventHandlers; /** * Unregister error handlers (API namespace) */ export declare function unregisterErrorHandlers(eventTypes?: string[], options?: { scope?: EventScope; }): void; /** * Clear error handlers (API namespace) */ export declare function clearErrorHandlers(options?: { scopes?: EventScope[]; }): void; /** * Register one-time error handler (API namespace) */ export declare function onceErrorHandler(eventType: string, handler: ErrorEventHandler, options?: Omit): void; /** * Emit error event at API namespace * Routes error to appropriate event factory method based on category */ export declare function emitErrorEvent(error: PackageErrorLike): void; export { ERROR_CATEGORY as ErrorCategory } from '@plyaz/types/errors'; //# sourceMappingURL=adapter.d.ts.map