import { Constructor } from '@dolittle/types'; import { Abstract } from '@dolittle/sdk.dependencyinversion'; import { Cancellation } from '@dolittle/sdk.resilience'; import { ScopeId } from '@dolittle/sdk.events'; import { Key } from '../Key'; import { CurrentState } from './CurrentState'; import { ProjectionId } from '../ProjectionId'; /** * Defines a system that knows about a projection. * @template TReadModel The type of the projection read model. */ export declare abstract class IProjectionOf { /** * Gets the {@link ProjectionId} identifier. */ abstract readonly identifier: ProjectionId; /** * Gets the {@link ScopeId}. */ abstract readonly scope: ScopeId; /** * Gets the projection read model by key. * @param {Key | any} key - The key of the projection. * @param {Cancellation} [cancellation] - The optional cancellation token. * @returns {Promise} A {@link Promise} that when resolved returns the read model of the projection. */ abstract get(key: Key | any, cancellation?: Cancellation): Promise; /** * Gets the projection state by key. * @param {Key | any} key - The key of the projection. * @param {Cancellation} [cancellation] - The optional cancellation token. * @returns {Promise>} A {@link Promise} that when resolved returns the current state of the projection. */ abstract getState(key: Key | any, cancellation?: Cancellation): Promise>; /** * Gets all projection read models. * @param {Cancellation} [cancellation] - The optional cancellation token. * @returns {Promise} A {@link Promise} that when resolved returns all the read models of the projection. */ abstract getAll(cancellation?: Cancellation): Promise; /** * Gets a {@link ServiceIdentifier} for a Projection read model type to inject an {@link IProjectionOf} from the service provider. * @param {Constructor} type - The type of the projection read model. * @returns {Abstract} The service identifier to use for injection. */ static for(type: Constructor): Abstract>; } //# sourceMappingURL=IProjectionOf.d.ts.map