import 'reflect-metadata'; import { Constructor } from '@cratis/fundamentals'; /** * TypeScript decorator that declares an event type as a compensation for another event type. * This is the TypeScript equivalent of the C# `[CompensationFor]` attribute. * * Chronicle registers the link with the event type's schema. A compensation event type can compensate * for one event type, and is appended with `IEventSequence.compensate()`. * * Apply it together with {@link eventType}; the order of the decorators does not matter. * * @param compensated - The class of the event type being compensated for. * @returns A class decorator. * * @example * ```typescript * @eventType() * class EntryPosted { constructor(readonly amount: number) {} } * * @eventType() * @compensationFor(EntryPosted) * class EntryReversed { constructor(readonly reason: string) {} } * ``` */ export declare function compensationFor(compensated: Constructor): (target: object, context?: ClassDecoratorContext) => void; /** * Gets the class of the event type that a class declared as a compensation with {@link compensationFor} compensates for. * @param target - The class constructor to inspect. * @returns The compensated event class, or undefined when the class is not a compensation. */ export declare function getCompensatedTypeFor(target: Function): Constructor | undefined; //# sourceMappingURL=compensationForDecorator.d.ts.map