@dolittle/sdk.projections
Version:
Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.
35 lines • 1.64 kB
TypeScript
import { Constructor } from '@dolittle/types';
import { Cancellation } from '@dolittle/sdk.resilience';
import { IProjectionStore } from './IProjectionStore';
import { Key } from '../Key';
import { CurrentState } from './CurrentState';
import { ScopedProjectionId } from './ScopedProjectionId';
import { IProjectionOf } from './IProjectionOf';
import { ProjectionId } from '../_exports';
import { ScopeId } from '@dolittle/sdk.events';
/**
* Represents an implementation of {@link IProjectionOf}.
* @template TReadModel The type of the projection read model.
*/
export declare class ProjectionOf<TReadModel> extends IProjectionOf<TReadModel> {
private _readModelType;
private readonly _projectionStore;
/** @inheritdoc */
readonly identifier: ProjectionId;
/** @inheritdoc */
readonly scope: ScopeId;
/**
* Initialises a new instance of the {@link ProjectionOf} class.
* @param {Constructor<TReadModel>} _readModelType - The type of the read model.
* @param {IProjectionStore} _projectionStore - The projection store to get the projection from.
* @param {ScopedProjectionId} identifier - The scoped projection identifier.
*/
constructor(_readModelType: Constructor<TReadModel>, _projectionStore: IProjectionStore, identifier: ScopedProjectionId);
/** @inheritdoc */
get(key: Key, cancellation?: Cancellation): Promise<TReadModel>;
/** @inheritdoc */
getState(key: Key, cancellation?: Cancellation): Promise<CurrentState<TReadModel>>;
/** @inheritdoc */
getAll(cancellation?: Cancellation): Promise<TReadModel[]>;
}
//# sourceMappingURL=ProjectionOf.d.ts.map