import 'reflect-metadata'; import { ReactorId } from './ReactorId.js'; /** * Metadata stored on a reactor class. */ export interface ReactorMetadata { /** The unique identifier for the reactor. */ readonly id: ReactorId; /** The optional explicit event sequence identifier. */ readonly eventSequenceId: string | undefined; } /** * TypeScript decorator that marks a class as a reactor and associates it with a unique * identifier. This is the TypeScript equivalent of the C# `[Reactor]` attribute. * * Reactors observe events from an event sequence and produce side effects. * Method dispatch is by convention: a handler's name is the event class name with * its first letter lowercased (for example, `projectRegistered` handles `ProjectRegistered`). * * @param id - The unique identifier for the reactor. Defaults to the class name if omitted. * @param eventSequenceId - Optional explicit event sequence identifier. * @returns A class decorator. * * @example * ```typescript * @reactor() * class ProjectRegisteredNotifier { * async projectRegistered(event: ProjectRegistered, context: EventContext): Promise { * console.log(`Project '${event.name}' was registered.`); * } * } * ``` */ export declare function reactor(id?: string, eventSequenceId?: string): ClassDecorator; /** * Gets the {@link ReactorMetadata} associated with a class decorated with {@link reactor}. * @param target - The class constructor to retrieve the metadata for. * @returns The associated ReactorMetadata, or undefined if not decorated. */ export declare function getReactorMetadata(target: Function): ReactorMetadata | undefined; /** * Checks whether a class has been decorated with {@link reactor}. * @param target - The class constructor to check. * @returns True if the class has a reactor decorator; false otherwise. */ export declare function isReactor(target: Function): boolean; //# sourceMappingURL=reactor.d.ts.map