import 'reflect-metadata'; import { PropertyAccessor } from '@cratis/fundamentals'; import type { EventContext } from '../../events/index.js'; import { ChroniclePropertyDecorator } from '../../types/propertyDecoratorMetadata.js'; /** Metadata stored by the setFromContext property decorator. */ export interface SetFromContextMetadata { /** The event constructor associated with this annotation. */ readonly eventType: Function; /** The event context property name to read the value from. Defaults to the decorated property name. */ readonly contextPropertyName?: string; } /** * Property decorator that maps a value from an event context property onto the decorated read model property. * @param eventType - The event constructor. * @param contextPropertyOrAccessor - Optional event context property name or property accessor. Defaults to the property name. * @returns A property decorator. */ export declare function setFromContext(eventType: Function, contextPropertyName?: string): ChroniclePropertyDecorator; export declare function setFromContext(eventType: Function, contextPropertyAccessor?: PropertyAccessor): ChroniclePropertyDecorator; /** * Retrieves all setFromContext metadata stored on the given property. * @param target - The class prototype. * @param propertyKey - The property name. * @returns An array of setFromContext metadata entries. */ export declare function getSetFromContextMetadata(target: object, propertyKey: string): SetFromContextMetadata[]; //# sourceMappingURL=setFromContext.d.ts.map