import { Guid } from '@dolittle/rudiments'; import { Constructor } from '@dolittle/types'; import { IClientBuildResults, IModelBuilder } from '@dolittle/sdk.common'; import { Generation } from '@dolittle/sdk.artifacts'; import { EventType, EventTypeIdLike, IEventTypes, ScopeId } from '@dolittle/sdk.events'; import { IProjection } from '../IProjection'; import { ProjectionCallback } from '../ProjectionCallback'; import { ProjectionId } from '../ProjectionId'; import { CopyToMongoDBCallback } from './Copies/CopyToMongoDBCallback'; import { IProjectionBuilderForReadModel } from './IProjectionBuilderForReadModel'; import { KeySelectorBuilderCallback } from './KeySelectorBuilderCallback'; import { ProjectionBuilder } from './ProjectionBuilder'; import { ProjectionAliasLike } from '../ProjectionAlias'; /** * Represents an implementation of {@link IProjectionBuilderForReadModel}. * @template T The type of the projection read model. */ export declare class ProjectionBuilderForReadModel extends IProjectionBuilderForReadModel { private readonly _projectionId; private readonly _readModelTypeOrInstance; private _scopeId; private readonly _modelBuilder; private readonly _parentBuilder; private _onMethods; private _alias?; private _copyToMongoDBCallback?; /** * Initializes a new instance of {@link ProjectionBuilder}. * @param {ProjectionId} _projectionId - The unique identifier of the projection to build for. * @param {Constructor | T} _readModelTypeOrInstance - The type or instance of the read model to build a projection for. * @param {ScopeId} _scopeId - The scope of the projection. * @param {IModelBuilder} _modelBuilder - For binding the parent projection builder and read model to its identifier. * @param {ProjectionBuilder} _parentBuilder - For binding the builder to the identifier. */ constructor(_projectionId: ProjectionId, _readModelTypeOrInstance: Constructor | T, _scopeId: ScopeId, _modelBuilder: IModelBuilder, _parentBuilder: ProjectionBuilder); /** @inheritdoc */ on(type: Constructor, keySelectorCallback: KeySelectorBuilderCallback, callback: ProjectionCallback): IProjectionBuilderForReadModel; on(eventType: EventType, keySelectorCallback: KeySelectorBuilderCallback, callback: ProjectionCallback): IProjectionBuilderForReadModel; on(eventTypeId: EventTypeIdLike, keySelectorCallback: KeySelectorBuilderCallback, callback: ProjectionCallback): IProjectionBuilderForReadModel; on(eventTypeId: EventTypeIdLike, generation: number | Generation, keySelectorCallback: KeySelectorBuilderCallback, callback: ProjectionCallback): IProjectionBuilderForReadModel; /** @inheritdoc */ inScope(scopeId: string | Guid | ScopeId): IProjectionBuilderForReadModel; /** @inheritdoc */ withAlias(alias: ProjectionAliasLike): IProjectionBuilderForReadModel; /** @inheritdoc */ copyToMongoDB(callback?: CopyToMongoDBCallback): IProjectionBuilderForReadModel; /** * Builds the projection. * @param {IEventTypes} eventTypes - For event types resolution. * @param {IClientBuildResults} results - For keeping track of build results. * @returns {IProjection | undefined} The built projection if successful. */ build(eventTypes: IEventTypes, results: IClientBuildResults): IProjection | undefined; private tryAddOnMethods; private getTypeOrEventTypeFrom; private getEventType; private buildCopies; private buildMongoDBCopies; private get _modelId(); } //# sourceMappingURL=ProjectionBuilderForReadModel.d.ts.map