UNPKG

@dolittle/sdk.projections

Version:

Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.

24 lines 1.46 kB
import { Constructor } from '@dolittle/types'; import { ProjectionCurrentState } from '@dolittle/contracts/Runtime/Projections/State_pb'; import { Key } from '../../Key'; import { CurrentState } from '../CurrentState'; /** * Defines a system that converts projections to SDK representations. */ export declare abstract class IConvertProjectionsToSDK { /** * Convert from the runtime respresentation to the SDK's representation of the current state of a projection. * @param {Constructor<TProjection> | undefined} type - The optional read model type to convert to. * @param {ProjectionCurrentState} source - The current state to convert. * @template TProjection The type of the projection. */ abstract convert<TProjection = any>(type: Constructor<TProjection> | undefined, source: ProjectionCurrentState): CurrentState<TProjection>; /** * Convert from an list of runtime respresentations of the current state of a projection to the SDK's representation. * @param {Constructor<TProjection> | undefined} type - The optional read model type to convert to. * @param {ProjectionCurrentState[]} sources - A list of states to convert. * @template TProjection The type of the projection. */ abstract convertAll<TProjection = any>(type: Constructor<TProjection> | undefined, sources: ProjectionCurrentState[]): Map<Key, CurrentState<TProjection>>; } //# sourceMappingURL=IConvertProjectionsToSDK.d.ts.map