import { type Archetype, type Props } from './Archetype'; import { type Id } from './Id'; /** * Define an entity in the common sense of DDD (Domain-Driven Design). * The properties passed to the constructor will be set with the provided value * and will only be accessible for reading and writing. */ export declare class Entity> implements Archetype { private readonly id; protected constructor(id: Id, props?: P); getId(): Id; /** * Compare two entities for equality * > if other object is not defined return false * > if this object and other object are not of the same type then return false * > if the id of this object properties is not same as the id of other object then return false * > otherwise return true * @param other the other archetype to compare * @returns true if the two entities are same, false otherwise */ equals(other: T): boolean; static create>(id: Id, props?: P): Entity; }