cqrs-eda
Version:
Lightweight CQRS and Event-Driven Architecture library using TypeScript decorators, handlers and typings. Perfect for scalable event-driven apps.
18 lines • 598 B
TypeScript
import { Constructor } from "../types/base";
/**
* Decorator to register a class as a Query handler under a unique name.
*
* @param name Unique identifier for the query.
* @throws Error if a query with the given name is already registered.
*
* @example
* ```ts
* @Query("GET_USER")
* export class GetUserQuery implements IQuery<{ id: number }, User> {
* async execute(params) { ... }
* }
* ```
*/
export declare function Query(name: string): (target: Constructor) => void;
export declare function getQueryRegistry(): Map<string, Constructor>;
//# sourceMappingURL=decorators.d.ts.map