import { PartialDeep } from 'type-fest'; import { Object } from "./Object"; import { EntityId } from "./EntityId"; /** * An entity's representation. * * Entities are objects that have a distinct identity * that runs through time and different representations. * * Example: * * ```typescript * class Post extends Entity<{ title: string; content: string }> { * get title() { * return this.props.title * } * * get content() { * return this.props.content * } * } * * const post = new Post({ title: 'Hello Rimo!', content: 'You are amazing :)' }) * // post.id -> generated * // post.title -> 'Hello Rimo!' * // post.content -> 'You are amazing :)' * ``` * * @typeParam T The properties of this entity */ export declare abstract class Entity implements Object { protected readonly _id: EntityId; readonly props: T; constructor(props: PartialDeep, id?: EntityId); populate(props: PartialDeep): void; get id(): EntityId; equals(object?: Entity): boolean; }