UNPKG

@typescript-eda/domain

Version:

Core domain primitives for event-driven architecture

25 lines 945 B
/** * @fileoverview This file defines the ValueObject class, a base class for objects that are defined by their properties, not by an identifier. * @author rydnr * @module domain/value-object */ /** * Represents a value object, which is an object defined by its properties rather than a unique identifier. * @template T The type of the properties of the value object. */ export declare abstract class ValueObject<T> { protected readonly props: T; /** * Creates an instance of ValueObject. * @param {T} props The properties of the value object. * @protected */ protected constructor(props: T); /** * Compares this value object with another for equality. * @param {ValueObject<T>} [vo] The value object to compare with. * @returns {boolean} True if the value objects are equal, false otherwise. */ equals(vo?: ValueObject<T>): boolean; } //# sourceMappingURL=value-object.d.ts.map