import 'reflect-metadata'; import { ReadModelId } from './ReadModelId.js'; import { JsonSchema } from '../schemas/index.js'; import { ChronicleClassDecorator } from '../types/standardDecoratorMetadata.js'; /** * Metadata stored on a read model class. */ export interface ReadModelMetadata { /** The unique identifier for the read model. */ readonly id: ReadModelId; /** The reflected members and their runtime types. */ readonly members: ReadonlyMap; /** The generated JSON schema for the read model. */ readonly schema: JsonSchema; } /** * TypeScript decorator that marks a class as a read model and captures reflection metadata. * @param id - The unique identifier for the read model. Defaults to the class name if omitted. * @returns A class decorator. * @deprecated Read models are discovered from @projection(..., ReadModelType), * @reducer(..., ReadModelType), or @fromEvent on the model. For a custom identifier, * declare `static readonly readModelId = 'custom-id'` on the model instead. */ export declare function readModel(id?: string): ChronicleClassDecorator; /** * Gets the {@link ReadModelMetadata} associated with a class decorated with {@link readModel}. * @param target - The class constructor to retrieve metadata for. * @returns The associated metadata, or undefined if not decorated. */ export declare function getReadModelMetadata(target: Function): ReadModelMetadata | undefined; /** * Checks whether a class has been decorated with {@link readModel}. * @param target - The class constructor to check. * @returns True if the class has a read model decorator; false otherwise. */ export declare function isReadModel(target: Function): boolean; /** Resolves the compatible identifier of a decorated or inferred read model. */ export declare function getReadModelId(target: Function): string; //# sourceMappingURL=readModel.d.ts.map