import 'reflect-metadata'; import { ChroniclePropertyDecorator } from '../../types/propertyDecoratorMetadata.js'; /** Metadata stored by the childrenFrom property decorator. */ export interface ChildrenFromMetadata { /** The event constructor that adds children to the collection. */ readonly eventType: Function; /** Optional child type for TypeScript runtimes without emitted generic metadata. */ readonly childType?: Function; /** The event property name used as the key for children. Defaults to the event source identifier. */ readonly key?: string; /** The child model property name used to uniquely identify instances in the collection. */ readonly identifiedBy?: string; /** The event property name used as the parent key. Defaults to the event source identifier. */ readonly parentKey?: string; } /** Options for the options form of the childrenFrom property decorator. */ export interface ChildrenFromOptions { /** The child type, for TypeScript runtimes without emitted generic metadata. */ readonly childType?: Function; /** The event property name used as the key for children. Defaults to the event source identifier. */ readonly key?: string; /** The child model property name used to uniquely identify instances in the collection. */ readonly identifiedBy?: string; /** The event property name used as the parent key. Defaults to the event source identifier. */ readonly parentKey?: string; } /** * Property decorator that configures a children collection sub-projection from an event type. * Use this form to name the child type and an explicit child key together. * @param eventType - The event constructor. * @param options - The child type, key, identifiedBy and parentKey. * @returns A property decorator. */ export declare function childrenFrom(eventType: Function, options: ChildrenFromOptions): ChroniclePropertyDecorator; /** * Property decorator that configures a children collection sub-projection from an event type. * @param eventType - The event constructor. * @param key - Optional event property name to use as the key for children, or the child constructor. * @param identifiedBy - Optional child model property name used to identify instances. * @param parentKey - Optional event property name used as the parent key. * @returns A property decorator. */ export declare function childrenFrom(eventType: Function, key?: string | Function, identifiedBy?: string, parentKey?: string): ChroniclePropertyDecorator; /** * Retrieves all childrenFrom metadata stored on the given property. * @param target - The class prototype. * @param propertyKey - The property name. * @returns An array of childrenFrom metadata entries. */ export declare function getChildrenFromMetadata(target: object, propertyKey: string): ChildrenFromMetadata[]; //# sourceMappingURL=childrenFrom.d.ts.map