@daiso-tech/core
Version:
The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.
73 lines (72 loc) • 2.69 kB
TypeScript
/**
* @module EventBus
*/
import type { IFlexibleSerde, ISerializable } from "../../serde/contracts/_module-exports.js";
import { type ISerializedError, type OneOrMore } from "../../utilities/_module-exports.js";
/**
*
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
* @group Errors
*/
export declare class EventBusError extends Error implements ISerializable<ISerializedError> {
static deserialize(deserializedValue: ISerializedError): EventBusError;
constructor(message: string, cause?: unknown);
serialize(): ISerializedError;
}
/**
*
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
* @group Errors
*/
export declare class UnexpectedEventBusError extends EventBusError {
static deserialize(deserializedValue: ISerializedError): EventBusError;
constructor(message: string, cause?: unknown);
}
/**
* The error is thrown when an unexpected error occurs while removing a listener.
*
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
* @group Errors
*/
export declare class UnableToRemoveListenerEventBusError extends UnexpectedEventBusError {
static deserialize(deserializedValue: ISerializedError): EventBusError;
constructor(message: string, cause?: unknown);
}
/**
* The error is thrown when an unexpected error occurs while adding a listener.
*
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
* @group Errors
*/
export declare class UnableToAddListenerEventBusError extends UnexpectedEventBusError {
static deserialize(deserializedValue: ISerializedError): EventBusError;
constructor(message: string, cause?: unknown);
}
/**
* The error is thrown when an unexpected error occurs while dispatching an event.
*
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
* @group Errors
*/
export declare class UnableToDispatchEventBusError extends UnexpectedEventBusError {
constructor(message: string, cause?: unknown);
}
/**
*
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
* @group Errors
*/
export declare const EVENT_BUS_ERRORS: {
Base: typeof EventBusError;
Unexpected: typeof UnexpectedEventBusError;
UnableToRemoveListener: typeof UnableToRemoveListenerEventBusError;
UnableToAddListener: typeof UnableToAddListenerEventBusError;
UnableToDispatch: typeof UnableToDispatchEventBusError;
};
/**
* The `registerEventBusErrorsToSerde` function registers all {@link IEventBus | `IEventBus`} related errors with `IFlexibleSerde`, ensuring they will properly be serialized and deserialized.
*
* IMPORT_PATH: `"@daiso-tech/core/event-bus/contracts"`
* @group Errors
*/
export declare function registerEventBusErrorsToSerde(serde: OneOrMore<IFlexibleSerde>): void;