domain-objects
Version:
A simple, convenient way to represent domain objects, leverage domain knowledge, and add runtime validation in your code base.
10 lines (9 loc) • 640 B
TypeScript
import type { DomainEntity } from '../instantiation/DomainEntity';
import type { DomainEvent } from '../instantiation/DomainEvent';
import type { DomainLiteral } from '../instantiation/DomainLiteral';
/**
* Extracts an object that identifies the domain object via unique key, for DomainEntity, DomainEvent, or DomainLiteral.
*
* Uses the definition of a DomainEntity, DomainEvent, or DomainLiteral in order to extract the properties that uniquely define the domain object, generically.
*/
export declare const getUniqueIdentifier: <T extends Record<string, any>>(obj: DomainEntity<T> | DomainEvent<T> | DomainLiteral<T>) => Partial<T>;