@dolittle/sdk.aggregates
Version:
Dolittle is a decentralized, distributed, event-driven microservice platform built to harness the power of events.
25 lines • 1.43 kB
TypeScript
import { Constructor } from '@dolittle/types';
import { Decorators } from '@dolittle/sdk.common';
import { AggregateRootIdLike } from '@dolittle/sdk.events';
import { AggregateRootType } from './AggregateRootType';
import { AggregateRootTypeOptions } from './AggregateRootTypeOptions';
/**
* Decorator to mark a class as an aggregate root.
* @param {AggregateRootIdLike} aggregateRootId - The identifier of the aggregate root.
* @param {AggregateRootTypeOptions} [options={}] - Options to give to the aggregate root.
* @returns {Decorators.Decorator} The decorator.
*/
export declare function aggregateRoot(aggregateRootId: AggregateRootIdLike, options?: AggregateRootTypeOptions): Decorators.Decorator;
/**
* Checks whether the specified class is decorated with an aggregate root type.
* @param {Constructor<any>} type - The class to check the decorated aggregate root type for.
* @returns {boolean} True if the decorator is applied, false if not.
*/
export declare function isDecoratedAggregateRootType(type: Constructor<any>): boolean;
/**
* Gets the decorated aggregate root type of the specified class.
* @param {Constructor<any>} type - The class to get the decorated aggregate root type for.
* @returns {AggregateRootType} The decorated aggregate root type.
*/
export declare function getDecoratedAggregateRootType(type: Constructor<any>): AggregateRootType;
//# sourceMappingURL=aggregateRootDecorator.d.ts.map