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) • 613 B
TypeScript
import { DomainEntity } from '../instantiation/DomainEntity';
import { DomainEvent } from '../instantiation/DomainEvent';
import { DomainLiteral } from '../instantiation/DomainLiteral';
/**
* Extracts an object that identifies the domain object via primary key, for DomainEntity, DomainEvent, or DomainLiteral.
*
* Uses the definition of a DomainEntity, DomainEvent, or DomainLiteral in order to extract the primary key of the dobj, generically.
*/
export declare const getPrimaryIdentifier: <T extends Record<string, any>>(obj: DomainEntity<T> | DomainEvent<T> | DomainLiteral<T>) => Partial<T> | undefined;